aboutsummaryrefslogtreecommitdiff
path: root/render/allocator.c
diff options
context:
space:
mode:
authorSimon Zeni <simon@bl4ckb0ne.ca>2021-04-29 12:01:28 -0400
committerSimon Ser <contact@emersion.fr>2021-05-05 10:40:21 +0200
commit2c90e0f521b2bb57d00e5a374b0eff99f3a2d744 (patch)
treea70a938e0431285f040b21bcf7e987dedbccb7ca /render/allocator.c
parentd0c1f0c0b6370a0462fcb30d041e37f22fe33076 (diff)
render/gbm_allocator: duplicate drm fd during creation process
Diffstat (limited to 'render/allocator.c')
-rw-r--r--render/allocator.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/render/allocator.c b/render/allocator.c
index 46d7b2de..6dd8592b 100644
--- a/render/allocator.c
+++ b/render/allocator.c
@@ -1,6 +1,5 @@
#define _POSIX_C_SOURCE 200809L
#include <assert.h>
-#include <fcntl.h>
#include <stdlib.h>
#include <wlr/util/log.h>
#include <xf86drm.h>
@@ -29,10 +28,7 @@ struct wlr_allocator *allocator_autocreate_with_drm_fd(
if ((backend_caps & gbm_caps) && (renderer_caps & gbm_caps)
&& drm_fd != -1) {
wlr_log(WLR_DEBUG, "Trying to create gbm allocator");
- int fd = fcntl(drm_fd, F_DUPFD_CLOEXEC, 0);
- if (fd < 0) {
- wlr_log(WLR_ERROR, "fcntl(F_DUPFD_CLOEXEC) failed");
- } else if ((alloc = wlr_gbm_allocator_create(fd)) != NULL) {
+ if ((alloc = wlr_gbm_allocator_create(drm_fd)) != NULL) {
return alloc;
}
wlr_log(WLR_DEBUG, "Failed to create gbm allocator");