commit:     96c8ba2fb5f91a711ef5bfcfd8affe0b74ad18fe
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Sat Apr 29 18:48:45 2017 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Sat Apr 29 18:48:45 2017 +0000
URL:        https://gitweb.gentoo.org/proj/openrc.git/commit/?id=96c8ba2f

supervise-daemon: mark all open file descriptors FD_CLOEXEC

 src/rc/supervise-daemon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c
index 2a24799c..2080e4a6 100644
--- a/src/rc/supervise-daemon.c
+++ b/src/rc/supervise-daemon.c
@@ -322,7 +322,7 @@ static void child_process(char *exec, char **argv)
                dup2(stderr_fd, STDERR_FILENO);
 
        for (i = getdtablesize() - 1; i >= 3; --i)
-               close(i);
+               fcntl(i, F_SETFD, FD_CLOEXEC);
 
        *cmdline = '\0';
        c = argv;

Reply via email to