aboutsummaryrefslogtreecommitdiffstats
path: root/src/egl/main/egldisplay.c
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2020-06-05 01:09:35 +0200
committerMarge Bot <[email protected]>2020-06-18 02:09:56 +0000
commit4a8085d67ca7b41690edf22c410e4dc0a28e3187 (patch)
tree40904aab7a15a75e3408b1cba8e2a8af8a7fc386 /src/egl/main/egldisplay.c
parent0e5ea7a36399815a2e39b72f3f0e3a75c44c062d (diff)
replace all F_DUPFD_CLOEXEC with os_dupfd_cloexec()
All squashed into a single commit because it shouldn't have any behaviour change, except that it might work now on platforms where it was broken because F_DUPFD_CLOEXEC is not supported but FD_CLOEXEC is. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5369>
Diffstat (limited to 'src/egl/main/egldisplay.c')
-rw-r--r--src/egl/main/egldisplay.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c
index f6e85c79aa9..8cf9cb83a91 100644
--- a/src/egl/main/egldisplay.c
+++ b/src/egl/main/egldisplay.c
@@ -39,6 +39,7 @@
#include <fcntl.h>
#include "c11/threads.h"
#include "util/macros.h"
+#include "util/os_file.h"
#include "util/u_atomic.h"
#include "eglcontext.h"
@@ -618,7 +619,7 @@ _eglGetDeviceDisplay(void *native_display,
* The new fd is guaranteed to be 3 or greater.
*/
if (fd != -1 && display->Options.fd == 0) {
- display->Options.fd = fcntl(fd, F_DUPFD_CLOEXEC, 3);
+ display->Options.fd = os_dupfd_cloexec(fd);
if (display->Options.fd == -1) {
/* Do not (really) need to teardown the display */
_eglError(EGL_BAD_ALLOC, "eglGetPlatformDisplay");