From a5fe9aa73633594b443e2a1a990cdf23addbb28b Mon Sep 17 00:00:00 2001 From: Greg V Date: Tue, 10 Oct 2017 01:23:43 +0300 Subject: Add FreeBSD compatibility --- xwayland/xwayland.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'xwayland/xwayland.c') diff --git a/xwayland/xwayland.c b/xwayland/xwayland.c index 2bec1b63..f1599911 100644 --- a/xwayland/xwayland.c +++ b/xwayland/xwayland.c @@ -1,5 +1,9 @@ #define _XOPEN_SOURCE 700 #define _DEFAULT_SOURCE +#ifdef __FreeBSD__ +// for SOCK_CLOEXEC +#define __BSD_VISIBLE 1 +#endif #include #include #include @@ -17,6 +21,14 @@ #include "sockets.h" #include "xwm.h" +#ifdef __FreeBSD__ +static inline int clearenv(void) { + extern char **environ; + environ[0] = NULL; + return 0; +} +#endif + static void safe_close(int fd) { if (fd >= 0) { close(fd); -- cgit v1.2.3