projects
/
platform
/
upstream
/
wayland.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d564823
)
client: handle fcntl error on bad fd in wl_display_connect
author
Manuel Stoeckl
<code@mstoeckl.com>
Sun, 1 Aug 2021 05:38:45 +0000
(
01:38
-0400)
committer
Simon Ser
<contact@emersion.fr>
Thu, 28 Oct 2021 12:30:43 +0000
(12:30 +0000)
This makes wl_display_connect fail immediately instead of
succeeding when the integer provided by WAYLAND_SOCKET does
not refer to a valid file descriptor.
Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
src/wayland-client.c
patch
|
blob
|
history
diff --git
a/src/wayland-client.c
b/src/wayland-client.c
index
63ce0d0
..
66f60e3
100644
(file)
--- a/
src/wayland-client.c
+++ b/
src/wayland-client.c
@@
-1246,7
+1246,9
@@
wl_display_connect(const char *name)
errno = prev_errno;
flags = fcntl(fd, F_GETFD);
- if (flags != -1)
+ if (flags == -1 && errno == EBADF)
+ return NULL;
+ else if (flags != -1)
fcntl(fd, F_SETFD, flags | FD_CLOEXEC);
unsetenv("WAYLAND_SOCKET");
} else {