From: Zbigniew Jędrzejewski-Szmek Date: Sun, 25 Feb 2018 20:07:18 +0000 (+0100) Subject: basic/exec-util: use _exit() to return from child X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=4ca4f6ccba9a4f6d1f3dda848934d8fc0af1de21;p=elogind.git basic/exec-util: use _exit() to return from child --- diff --git a/src/basic/exec-util.c b/src/basic/exec-util.c index 246cc4f4f..336bb7ca5 100644 --- a/src/basic/exec-util.c +++ b/src/basic/exec-util.c @@ -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); }