chiark / gitweb /
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)
committerSven Eden <yamakuzure@gmx.net>
Wed, 30 May 2018 05:59:05 +0000 (07:59 +0200)
src/basic/exec-util.c

index 246cc4f4f844fbb1a370a992975c9037c4f46e5e..336bb7ca555a7418b2b0e56ea4e6bf35fea9f5e6 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);
                 }