From: Michael Stapelberg Date: Tue, 15 Nov 2011 23:39:43 +0000 (+0000) Subject: ipc: set CLOEXEC on client file descriptors (Thanks biiter) X-Git-Tag: 4.2~250 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7498ddd12f32a3038e06cf9178473e8f38e98bf7;p=i3%2Fi3 ipc: set CLOEXEC on client file descriptors (Thanks biiter) --- diff --git a/src/ipc.c b/src/ipc.c index 0a738427..fe1464e6 100644 --- 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));