basic/exec-util: use _exit() to return from child

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2018-02-26 15:47:12 +01:00
parent 00d4b1e684
commit 3554ef5177
+1 -1
View File
@@ -65,7 +65,7 @@ static int do_spawn(const char *path, char *argv[], int stdout_fd, pid_t *pid) {
/* If the fd happens to be in the right place, go along with that */
if (stdout_fd != STDOUT_FILENO &&
dup2(stdout_fd, STDOUT_FILENO) < 0)
return -errno;
_exit(EXIT_FAILURE);
(void) fd_cloexec(STDOUT_FILENO, false);
}