Fix fd leak to children

This commit is contained in:
o9000
2017-07-16 10:14:40 +02:00
parent a46d22b31f
commit f4ec61340f
3 changed files with 14 additions and 1 deletions

View File

@@ -644,6 +644,7 @@ void execp_timer_callback(void *arg)
close(pipe_fd_stderr[0]);
dup2(pipe_fd_stderr[1], 2); // 2 is stderr
close(pipe_fd_stderr[1]);
close_all_fds();
setpgid(0, 0);
execl("/bin/sh", "/bin/sh", "-c", execp->backend->command, NULL);
// This should never happen!