aboutsummaryrefslogtreecommitdiff
path: root/backend/x11/backend.c
diff options
context:
space:
mode:
Diffstat (limited to 'backend/x11/backend.c')
-rw-r--r--backend/x11/backend.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/backend/x11/backend.c b/backend/x11/backend.c
index 9482f86d..48f1aaee 100644
--- a/backend/x11/backend.c
+++ b/backend/x11/backend.c
@@ -1,6 +1,6 @@
-#define _POSIX_C_SOURCE 200112L
-
+#define _POSIX_C_SOURCE 200809L
#include <assert.h>
+#include <fcntl.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
@@ -490,9 +490,9 @@ struct wlr_backend *wlr_x11_backend_create(struct wl_display *display,
return false;
}
- drm_fd = dup(drm_fd);
- if (fd < 0) {
- wlr_log_errno(WLR_ERROR, "dup failed");
+ drm_fd = fcntl(drm_fd, F_DUPFD_CLOEXEC, 0);
+ if (drm_fd < 0) {
+ wlr_log_errno(WLR_ERROR, "fcntl(F_DUPFD_CLOEXEC) failed");
return false;
}