mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 19:40:10 +01:00
etnaviv: replace all dup() with os_dupfd_cloexec()
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>
This commit is contained in:
parent
419b446e1e
commit
bd5cf70d3d
2 changed files with 5 additions and 3 deletions
|
|
@ -25,6 +25,7 @@
|
|||
*/
|
||||
|
||||
#include "util/hash_table.h"
|
||||
#include "util/os_file.h"
|
||||
|
||||
#include "etnaviv_priv.h"
|
||||
#include "etnaviv_drmif.h"
|
||||
|
|
@ -63,7 +64,7 @@ struct etna_device *etna_device_new(int fd)
|
|||
* which is close()d when the device is finalized. */
|
||||
struct etna_device *etna_device_new_dup(int fd)
|
||||
{
|
||||
int dup_fd = dup(fd);
|
||||
int dup_fd = os_dupfd_cloexec(fd);
|
||||
struct etna_device *dev = etna_device_new(dup_fd);
|
||||
|
||||
if (dev)
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#include "etnaviv_context.h"
|
||||
#include "etnaviv_screen.h"
|
||||
|
||||
#include "util/os_file.h"
|
||||
#include "util/u_inlines.h"
|
||||
#include "util/u_memory.h"
|
||||
|
||||
|
|
@ -79,7 +80,7 @@ etna_create_fence_fd(struct pipe_context *pctx,
|
|||
enum pipe_fd_type type)
|
||||
{
|
||||
assert(type == PIPE_FD_TYPE_NATIVE_SYNC);
|
||||
*pfence = etna_fence_create(pctx, dup(fd));
|
||||
*pfence = etna_fence_create(pctx, os_dupfd_cloexec(fd));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -96,7 +97,7 @@ static int
|
|||
etna_screen_fence_get_fd(struct pipe_screen *pscreen,
|
||||
struct pipe_fence_handle *pfence)
|
||||
{
|
||||
return dup(pfence->fence_fd);
|
||||
return os_dupfd_cloexec(pfence->fence_fd);
|
||||
}
|
||||
|
||||
struct pipe_fence_handle *
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue