]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic/exec-util: use _exit() to return from child
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 25 Feb 2018 20:07:18 +0000 (21:07 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 26 Feb 2018 14:47:12 +0000 (15:47 +0100)
src/basic/exec-util.c

index 0829b3d836c09144314c5f7ac4511319911fdd3a..d20e09dc5407f7ea21850cf4d8ede2599c83f755 100644 (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);
                 }