From 4a8085d67ca7b41690edf22c410e4dc0a28e3187 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Fri, 5 Jun 2020 01:09:35 +0200 Subject: replace all F_DUPFD_CLOEXEC with os_dupfd_cloexec() All squashed into a single commit because it shouldn't have any behaviour change, except that it might work now on platforms where it was broken because F_DUPFD_CLOEXEC is not supported but FD_CLOEXEC is. Signed-off-by: Eric Engestrom Reviewed-by: Kristian H. Kristensen Reviewed-by: Lionel Landwerlin Part-of: --- src/gallium/winsys/virgl/drm/virgl_drm_winsys.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/gallium/winsys/virgl') diff --git a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c index b19bdf4b6f8..01ca1018172 100644 --- a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c +++ b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c @@ -29,6 +29,7 @@ #include #include "os/os_mman.h" +#include "util/os_file.h" #include "util/os_time.h" #include "util/u_memory.h" #include "util/format/u_format.h" @@ -1046,7 +1047,7 @@ virgl_drm_screen_create(int fd, const struct pipe_screen_config *config) virgl_screen(pscreen)->refcnt++; } else { struct virgl_winsys *vws; - int dup_fd = fcntl(fd, F_DUPFD_CLOEXEC, 3); + int dup_fd = os_dupfd_cloexec(fd); vws = virgl_drm_winsys_create(dup_fd); if (!vws) { -- cgit v1.2.3