projects
/
profile
/
ivi
/
wayland.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
92d61f1
)
connection: Handle fd passing in an CLOEXEC safe way
author
Kristian Høgsberg
<krh@bitplanet.net>
Wed, 4 May 2011 16:35:16 +0000
(12:35 -0400)
committer
Kristian Høgsberg
<krh@bitplanet.net>
Wed, 4 May 2011 16:35:16 +0000
(12:35 -0400)
wayland/connection.c
patch
|
blob
|
history
diff --git
a/wayland/connection.c
b/wayland/connection.c
index
0d705b5
..
bade37f
100644
(file)
--- a/
wayland/connection.c
+++ b/
wayland/connection.c
@@
-300,7
+300,7
@@
wl_connection_data(struct wl_connection *connection, uint32_t mask)
msg.msg_flags = 0;
do {
- len = recvmsg(connection->fd, &msg,
0
);
+ len = recvmsg(connection->fd, &msg,
MSG_CMSG_CLOEXEC
);
} while (len < 0 && errno == EINTR);
if (len < 0) {
@@
-459,7
+459,7
@@
wl_connection_vmarshal(struct wl_connection *connection,
extra += sizeof *fd_ptr;
fd = va_arg(ap, int);
- dup_fd =
dup(fd
);
+ dup_fd =
fcntl(fd, F_DUPFD_CLOEXEC, 0
);
if (dup_fd < 0) {
fprintf(stderr, "dup failed: %m");
abort();