From 42ed8a6c9ccfb8b6b632c3be90fb03d292f53d25 Mon Sep 17 00:00:00 2001 From: Matt Whitlock Date: Sat, 1 Oct 2016 23:49:45 -0400 Subject: gallium/winsys: replace calls to dup(2) with fcntl(F_DUPFD_CLOEXEC) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this fix, duplicated file descriptors leak into child processes. See commit aaac913e901229d11a1894f6aaf646de6b1a542c for one instance where the same fix was employed. Cc: Signed-off-by: Matt Whitlock Reviewed-by: Nicolai Hähnle --- src/gallium/winsys/vc4/drm/vc4_drm_winsys.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/gallium/winsys/vc4/drm') diff --git a/src/gallium/winsys/vc4/drm/vc4_drm_winsys.c b/src/gallium/winsys/vc4/drm/vc4_drm_winsys.c index c5434ad..23fe8e7 100644 --- a/src/gallium/winsys/vc4/drm/vc4_drm_winsys.c +++ b/src/gallium/winsys/vc4/drm/vc4_drm_winsys.c @@ -22,6 +22,7 @@ */ #include +#include #include "vc4_drm_public.h" @@ -30,5 +31,5 @@ struct pipe_screen * vc4_drm_screen_create(int fd) { - return vc4_screen_create(dup(fd)); + return vc4_screen_create(fcntl(fd, F_DUPFD_CLOEXEC, 3)); } -- cgit v1.1