diff options
Diffstat (limited to 'src/home')
-rw-r--r-- | src/home/homed-home.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/home/homed-home.c b/src/home/homed-home.c index e6b7740600..413fcf1773 100644 --- a/src/home/homed-home.c +++ b/src/home/homed-home.c @@ -1180,8 +1180,9 @@ static int home_start_work(Home *h, const char *verb, UserRecord *hr, UserRecord return -errno; r = safe_fork_full("(sd-homework)", - (int[]) { stdin_fd, stdout_fd }, 2, - FORK_RESET_SIGNALS|FORK_CLOSE_ALL_FDS|FORK_DEATHSIG|FORK_LOG|FORK_REOPEN_LOG, &pid); + (int[]) { stdin_fd, stdout_fd, STDERR_FILENO }, + NULL, 0, + FORK_RESET_SIGNALS|FORK_CLOSE_ALL_FDS|FORK_DEATHSIG|FORK_REARRANGE_STDIO|FORK_LOG|FORK_REOPEN_LOG, &pid); if (r < 0) return r; if (r == 0) { @@ -1226,13 +1227,6 @@ static int home_start_work(Home *h, const char *verb, UserRecord *hr, UserRecord if (r < 0) log_warning_errno(r, "Failed to update $SYSTEMD_EXEC_PID, ignoring: %m"); - r = rearrange_stdio(TAKE_FD(stdin_fd), TAKE_FD(stdout_fd), STDERR_FILENO); /* fds are invalidated by rearrange_stdio() even on failure */ - if (r < 0) { - log_error_errno(r, "Failed to rearrange stdin/stdout/stderr: %m"); - _exit(EXIT_FAILURE); - } - - /* Allow overriding the homework path via an environment variable, to make debugging * easier. */ homework = getenv("SYSTEMD_HOMEWORK_PATH") ?: SYSTEMD_HOMEWORK_PATH; |