1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-02-04 17:47:03 +03:00

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

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2018-02-25 21:07:18 +01:00
parent 00d4b1e684
commit 3554ef5177

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);
}