aboutsummaryrefslogtreecommitdiff
path: root/xwayland/xwayland.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-10-11 08:54:28 -0400
committerGitHub <noreply@github.com>2017-10-11 08:54:28 -0400
commitbf5299a3a55040d8593c87d02bec364784c2c911 (patch)
tree690fe47fe25765394a13b2eb60f6870cc483a707 /xwayland/xwayland.c
parentf7bcb2750b4756ed2b5231a8a2831f26ab6d93ef (diff)
parenta5fe9aa73633594b443e2a1a990cdf23addbb28b (diff)
Merge pull request #252 from myfreeweb/freebsd-compat
Add FreeBSD compatibility
Diffstat (limited to 'xwayland/xwayland.c')
-rw-r--r--xwayland/xwayland.c12
1 files changed, 12 insertions, 0 deletions
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 <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@@ -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);