diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-02-28 23:32:49 +0100 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2018-05-30 07:59:13 +0200 |
commit | 55d5be46056010efe73e68b1bc3dd68402fcd1f9 (patch) | |
tree | e5ea2b604e454d3a761c93dbae33a49fd1c3dda6 /src/basic/exec-util.c | |
parent | fd3caa442196f284cba9614f6748dc601f7a6cf2 (diff) |
tree-wide: port various places over to use new rearrange_stdio()
Diffstat (limited to 'src/basic/exec-util.c')
-rw-r--r-- | src/basic/exec-util.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/basic/exec-util.c b/src/basic/exec-util.c index 336bb7ca5..f8ac40671 100644 --- a/src/basic/exec-util.c +++ b/src/basic/exec-util.c @@ -62,12 +62,9 @@ static int do_spawn(const char *path, char *argv[], int stdout_fd, pid_t *pid) { char *_argv[2]; if (stdout_fd >= 0) { - /* 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) + r = rearrange_stdio(STDIN_FILENO, stdout_fd, STDERR_FILENO); + if (r < 0) _exit(EXIT_FAILURE); - - (void) fd_cloexec(STDOUT_FILENO, false); } if (!argv) { |