diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-10-11 08:54:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-11 08:54:28 -0400 |
commit | bf5299a3a55040d8593c87d02bec364784c2c911 (patch) | |
tree | 690fe47fe25765394a13b2eb60f6870cc483a707 /backend/session/direct-ipc.c | |
parent | f7bcb2750b4756ed2b5231a8a2831f26ab6d93ef (diff) | |
parent | a5fe9aa73633594b443e2a1a990cdf23addbb28b (diff) |
Merge pull request #252 from myfreeweb/freebsd-compat
Add FreeBSD compatibility
Diffstat (limited to 'backend/session/direct-ipc.c')
-rw-r--r-- | backend/session/direct-ipc.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/backend/session/direct-ipc.c b/backend/session/direct-ipc.c index 5f1494a6..0ea51e2f 100644 --- a/backend/session/direct-ipc.c +++ b/backend/session/direct-ipc.c @@ -1,4 +1,8 @@ #define _POSIX_C_SOURCE 200809L +#ifdef __FreeBSD__ +#define __BSD_VISIBLE 1 +#define INPUT_MAJOR 0 +#endif #include <errno.h> #include <stdio.h> #include <stdlib.h> @@ -8,10 +12,12 @@ #include <sys/socket.h> #include <sys/stat.h> #include <sys/types.h> -#include <sys/sysmacros.h> #include <sys/wait.h> -#include <xf86drm.h> +#ifdef __linux__ +#include <sys/sysmacros.h> #include <linux/major.h> +#endif +#include <xf86drm.h> #include <wlr/util/log.h> #include "backend/session/direct-ipc.h" @@ -35,11 +41,12 @@ static bool have_permissions(void) { } #else static bool have_permissions(void) { +#ifdef __linux__ if (geteuid() != 0) { wlr_log(L_ERROR, "Do not have root privileges; cannot become DRM master"); return false; } - +#endif return true; } #endif |