svga: replace all dup() with os_dupfd_cloexec()
authorEric Engestrom <eric@engestrom.ch>
Fri, 5 Jun 2020 08:55:35 +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/svga/drm/vmw_screen_svga.c

index 38ef3bcb9feb38d4278775424333f67d971522d6..334adde7b316bfe53e5eed22d7e160470e726284 100644 (file)
@@ -37,6 +37,7 @@
 #include "svga_cmd.h"
 #include "svga3d_caps.h"
 
+#include "util/os_file.h"
 #include "util/u_inlines.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
@@ -143,7 +144,7 @@ vmw_svga_winsys_fence_get_fd(struct svga_winsys_screen *sws,
                              boolean duplicate)
 {
    if (duplicate)
-      return dup(vmw_fence_get_fd(fence));
+      return os_dupfd_cloexec(vmw_fence_get_fd(fence));
    else
       return vmw_fence_get_fd(fence);
 }
@@ -154,7 +155,7 @@ vmw_svga_winsys_fence_create_fd(struct svga_winsys_screen *sws,
                                 struct pipe_fence_handle **fence,
                                 int32_t fd)
 {
-   *fence = vmw_fence_create(NULL, 0, 0, 0, dup(fd));
+   *fence = vmw_fence_create(NULL, 0, 0, 0, os_dupfd_cloexec(fd));
 }
 
 static int