gallium/winsys: replace calls to dup(2) with fcntl(F_DUPFD_CLOEXEC)
authorMatt Whitlock <freedesktop@mattwhitlock.name>
Sun, 2 Oct 2016 03:49:45 +0000 (23:49 -0400)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Tue, 4 Oct 2016 09:09:03 +0000 (11:09 +0200)
commit42ed8a6c9ccfb8b6b632c3be90fb03d292f53d25
tree40dd06c9d73546f182915bdb13c00653cc5d458e
parentac6064f91898065c8b82255190a0508204d3f88c
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: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Matt Whitlock <freedesktop@mattwhitlock.name>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c
src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
src/gallium/winsys/svga/drm/vmw_screen.c
src/gallium/winsys/vc4/drm/vc4_drm_winsys.c
src/gallium/winsys/virgl/drm/virgl_drm_winsys.c