summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/fastd.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/fastd.c b/src/fastd.c
index f72b351..9f1f60b 100644
--- a/src/fastd.c
+++ b/src/fastd.c
@@ -507,9 +507,6 @@ static int daemonize(void) {
if (pipe(pipefd))
exit_errno("pipe");
- fastd_setfd(pipefd[0], FD_CLOEXEC, 0);
- fastd_setfd(pipefd[1], FD_CLOEXEC, 0);
-
pid_t fork1 = fork();
if (fork1 < 0) {
@@ -547,6 +544,7 @@ static int daemonize(void) {
}
else {
/* child 2 */
+ fastd_setfd(pipefd[1], FD_CLOEXEC, 0);
return pipefd[1];
}
}