virgl: replace all dup() with os_dupfd_cloexec()
authorEric Engestrom <eric@engestrom.ch>
Fri, 5 Jun 2020 08:55:41 +0000 (10:55 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 18 Jun 2020 02:09:56 +0000 (02:09 +0000)
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5369>

src/gallium/winsys/virgl/drm/virgl_drm_winsys.c

index 01ca10181725ed42cc4fbd6dd9b711b5b20e6c99..c6cc99bbe0ea3c0a63dcf07c6b1dd75695ed7387 100644 (file)
@@ -664,7 +664,7 @@ virgl_drm_fence_create(struct virgl_winsys *vws, int fd, bool external)
    assert(vws->supports_fences);
 
    if (external) {
-      fd = dup(fd);
+      fd = os_dupfd_cloexec(fd);
       if (fd < 0)
          return NULL;
    }
@@ -891,7 +891,7 @@ static int virgl_fence_get_fd(struct virgl_winsys *vws,
    if (!vws->supports_fences)
       return -1;
 
-   return dup(fence->fd);
+   return os_dupfd_cloexec(fence->fd);
 }
 
 static int virgl_drm_get_version(int fd)