anv: replace all dup() with os_dupfd_cloexec()
authorEric Engestrom <eric@engestrom.ch>
Fri, 5 Jun 2020 08:54:43 +0000 (10:54 +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/intel/vulkan/anv_queue.c

index f6e3fdd6177cf960aea352a260d26fa49df5d9b1..1e3801daf4a8119ad7400a34daadf48369663021 100644 (file)
@@ -29,6 +29,8 @@
 #include <fcntl.h>
 #include <unistd.h>
 
+#include "util/os_file.h"
+
 #include "anv_private.h"
 #include "vk_util.h"
 
@@ -295,7 +297,7 @@ anv_queue_submit_timeline_locked(struct anv_queue *queue,
          struct anv_semaphore_impl *impl = &semaphore->permanent;
 
          assert(impl->type == ANV_SEMAPHORE_TYPE_SYNC_FILE);
-         impl->fd = dup(submit->out_fence);
+         impl->fd = os_dupfd_cloexec(submit->out_fence);
       }
    } else {
       /* Unblock any waiter by signaling the points, the application will get