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>
* Don't do this! Ensure that each library/bufmgr has its own device
* fd so that its namespace does not clash with another.
*/
- bufmgr->fd = dup(fd);
+ bufmgr->fd = os_dupfd_cloexec(fd);
if (bufmgr->fd < 0) {
free(bufmgr);
return NULL;
#include <libsync.h> /* Requires Android or libdrm-2.4.72 */
+#include "util/os_file.h"
+
#include "brw_context.h"
#include "intel_batchbuffer.h"
goto fail;
} else {
/* Import the sync fd as an in-fence. */
- fence->sync_fd = dup(fd);
+ fence->sync_fd = os_dupfd_cloexec(fd);
}
assert(fence->sync_fd != -1);
brw_dri_get_fence_fd_locked(struct brw_fence *fence)
{
assert(fence->type == BRW_FENCE_TYPE_SYNC_FD);
- return dup(fence->sync_fd);
+ return os_dupfd_cloexec(fence->sync_fd);
}
static int