mirror of
https://github.com/systemd/systemd.git
synced 2026-07-19 05:50:07 +00:00
tree-wide: port various places over to use new rearrange_stdio()
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user