diff options
author | Greg V <greg@unrelenting.technology> | 2017-10-10 01:23:43 +0300 |
---|---|---|
committer | Greg V <greg@unrelenting.technology> | 2017-10-11 00:07:21 +0300 |
commit | a5fe9aa73633594b443e2a1a990cdf23addbb28b (patch) | |
tree | 561968f504eb29d4f3bf9cd2a3c1ba5d89e44471 /backend/session/direct-ipc.c | |
parent | c39bfe7f84818be9d9901e30ba26db9e8f19c47e (diff) |
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 |