diff options
author | Samuel Čavoj <samuel@cavoj.net> | 2022-03-13 12:28:55 +0100 |
---|---|---|
committer | Samuel Čavoj <samuel@cavoj.net> | 2022-03-13 13:28:48 +0100 |
commit | 5c17452ae008d001b2529a6437916ea17403588d (patch) | |
tree | a85dcbad13ae773f6575be7ceccbee426e46a94a /render/allocator | |
parent | 4c8ecfcd4ab84d67a0677967d1fc98d5062ab6ae (diff) |
Pass O_CLOEXEC to drmModeCreateLease calls
The lease_fd is currently being leaked to child processes
Link: https://github.com/swaywm/sway/issues/4286#issuecomment-1065987957
Diffstat (limited to 'render/allocator')
-rw-r--r-- | render/allocator/allocator.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/render/allocator/allocator.c b/render/allocator/allocator.c index 0597cf25..2c75421f 100644 --- a/render/allocator/allocator.c +++ b/render/allocator/allocator.c @@ -30,7 +30,7 @@ static int reopen_drm_node(int drm_fd, bool allow_render_node) { if (drmIsMaster(drm_fd)) { // Only recent kernels support empty leases uint32_t lessee_id; - int lease_fd = drmModeCreateLease(drm_fd, NULL, 0, 0, &lessee_id); + int lease_fd = drmModeCreateLease(drm_fd, NULL, 0, O_CLOEXEC, &lessee_id); if (lease_fd >= 0) { return lease_fd; } else if (lease_fd != -EINVAL && lease_fd != -EOPNOTSUPP) { |