mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 20:38:06 +02:00
lavapipe: replace dup() with os_dupfd_cloexec()
dup() will leak the new FD into any child process after fork(). Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26203>
This commit is contained in:
parent
0be6b65f41
commit
d951ca056a
1 changed files with 2 additions and 1 deletions
|
|
@ -37,6 +37,7 @@
|
|||
#include "frontend/drisw_api.h"
|
||||
|
||||
#include "util/u_inlines.h"
|
||||
#include "util/os_file.h"
|
||||
#include "util/os_memory.h"
|
||||
#include "util/os_time.h"
|
||||
#include "util/u_thread.h"
|
||||
|
|
@ -2400,7 +2401,7 @@ lvp_GetMemoryFdKHR(VkDevice _device, const VkMemoryGetFdInfoKHR *pGetFdInfo, int
|
|||
assert(pGetFdInfo->sType == VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR);
|
||||
assert_memhandle_type(pGetFdInfo->handleType);
|
||||
|
||||
*pFD = dup(memory->backed_fd);
|
||||
*pFD = os_dupfd_cloexec(memory->backed_fd);
|
||||
assert(*pFD >= 0);
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue