From: Ondrej Kozina Date: Wed, 12 Nov 2014 08:50:59 +0000 (+0100) Subject: libdaemon: set CLOEXEC on client socket fd X-Git-Tag: v2_02_117~254 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=9dd81df8b25a51c919679b5f1c4e5fea9269972b;p=lvm2.git libdaemon: set CLOEXEC on client socket fd --- diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c index a8afcc1de..3dffdbb0b 100644 --- a/libdaemon/server/daemon-server.c +++ b/libdaemon/server/daemon-server.c @@ -470,6 +470,9 @@ static int handle_connect(daemon_state s) if (client.socket_fd < 0) return 0; + if (fcntl(client.socket_fd, F_SETFD, FD_CLOEXEC)) + WARN(&s, "setting CLOEXEC on client socket fd %d failed", client.socket_fd); + if (!(ts = dm_malloc(sizeof(thread_state)))) { if (close(client.socket_fd)) perror("close");