mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
gallium/auxiliary: replace call to dup(2) with fcntl(F_DUPFD_CLOEXEC)
Without this fix, duplicated file descriptors leak into child processes. See commitaaac913e90for one instance where the same fix was employed. Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Matt Whitlock <freedesktop@mattwhitlock.name> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (cherry picked from commit5d0069eca2)
This commit is contained in:
parent
d82738fbd9
commit
ea3e778bff
1 changed files with 2 additions and 1 deletions
|
|
@ -26,6 +26,7 @@
|
|||
**************************************************************************/
|
||||
|
||||
#include <assert.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "pipe/p_screen.h"
|
||||
#include "pipe-loader/pipe_loader.h"
|
||||
|
|
@ -47,7 +48,7 @@ vl_drm_screen_create(int fd)
|
|||
if (!vscreen)
|
||||
return NULL;
|
||||
|
||||
if (fd < 0 || (new_fd = dup(fd)) < 0)
|
||||
if (fd < 0 || (new_fd = fcntl(fd, F_DUPFD_CLOEXEC, 3)) < 0)
|
||||
goto free_screen;
|
||||
|
||||
if (pipe_loader_drm_probe_fd(&vscreen->dev, new_fd))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue