]> sourceware.org Git - lvm2.git/commitdiff
libdaemon: set CLOEXEC on client socket fd
authorOndrej Kozina <okozina@redhat.com>
Wed, 12 Nov 2014 08:50:59 +0000 (09:50 +0100)
committerOndrej Kozina <okozina@redhat.com>
Mon, 2 Feb 2015 09:15:52 +0000 (10:15 +0100)
libdaemon/server/daemon-server.c

index a8afcc1dede177310f63be6c0041817256d565e5..3dffdbb0bd0e0e88192a707f7d1e527f0a115016 100644 (file)
@@ -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");
This page took 0.037789 seconds and 5 git commands to generate.