1 |
commit: 96c8ba2fb5f91a711ef5bfcfd8affe0b74ad18fe |
2 |
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com> |
3 |
AuthorDate: Sat Apr 29 18:48:45 2017 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Apr 29 18:48:45 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=96c8ba2f |
7 |
|
8 |
supervise-daemon: mark all open file descriptors FD_CLOEXEC |
9 |
|
10 |
src/rc/supervise-daemon.c | 2 +- |
11 |
1 file changed, 1 insertion(+), 1 deletion(-) |
12 |
|
13 |
diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c |
14 |
index 2a24799c..2080e4a6 100644 |
15 |
--- a/src/rc/supervise-daemon.c |
16 |
+++ b/src/rc/supervise-daemon.c |
17 |
@@ -322,7 +322,7 @@ static void child_process(char *exec, char **argv) |
18 |
dup2(stderr_fd, STDERR_FILENO); |
19 |
|
20 |
for (i = getdtablesize() - 1; i >= 3; --i) |
21 |
- close(i); |
22 |
+ fcntl(i, F_SETFD, FD_CLOEXEC); |
23 |
|
24 |
*cmdline = '\0'; |
25 |
c = argv; |