]> git.sur5r.net Git - i3/i3/commitdiff
ipc: set CLOEXEC on client file descriptors (Thanks biiter)
authorMichael Stapelberg <michael@stapelberg.de>
Tue, 15 Nov 2011 23:39:43 +0000 (23:39 +0000)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 15 Nov 2011 23:39:43 +0000 (23:39 +0000)
src/ipc.c

index 0a738427eb101f26c669611f1646ab6145f6ee8a..fe1464e6c41d2da6d6dbdd4a6f71d6ec343ea62c 100644 (file)
--- a/src/ipc.c
+++ b/src/ipc.c
@@ -823,6 +823,9 @@ void ipc_new_client(EV_P_ struct ev_io *w, int revents) {
         return;
     }
 
+    /* Close this file descriptor on exec() */
+    (void)fcntl(client, F_SETFD, FD_CLOEXEC);
+
     set_nonblock(client);
 
     struct ev_io *package = scalloc(sizeof(struct ev_io));