diff options
author | Matt Whitlock <[email protected]> | 2016-10-01 23:49:45 -0400 |
---|---|---|
committer | Nicolai Hähnle <[email protected]> | 2016-10-04 11:09:03 +0200 |
commit | 42ed8a6c9ccfb8b6b632c3be90fb03d292f53d25 (patch) | |
tree | 40dd06c9d73546f182915bdb13c00653cc5d458e /src/gallium/winsys/svga | |
parent | ac6064f91898065c8b82255190a0508204d3f88c (diff) |
gallium/winsys: replace calls to dup(2) with fcntl(F_DUPFD_CLOEXEC)
Without this fix, duplicated file descriptors leak into child processes.
See commit aaac913e901229d11a1894f6aaf646de6b1a542c for one instance
where the same fix was employed.
Cc: <[email protected]>
Signed-off-by: Matt Whitlock <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/winsys/svga')
-rw-r--r-- | src/gallium/winsys/svga/drm/vmw_screen.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/winsys/svga/drm/vmw_screen.c b/src/gallium/winsys/svga/drm/vmw_screen.c index 74c77c54e84..d0bfcd728bf 100644 --- a/src/gallium/winsys/svga/drm/vmw_screen.c +++ b/src/gallium/winsys/svga/drm/vmw_screen.c @@ -39,6 +39,7 @@ #endif #include <sys/stat.h> #include <unistd.h> +#include <fcntl.h> static struct util_hash_table *dev_hash = NULL; @@ -88,7 +89,7 @@ vmw_winsys_create( int fd ) vws->device = stat_buf.st_rdev; vws->open_count = 1; - vws->ioctl.drm_fd = dup(fd); + vws->ioctl.drm_fd = fcntl(fd, F_DUPFD_CLOEXEC, 3); vws->base.have_gb_dma = TRUE; vws->base.need_to_rebind_resources = FALSE; |