diff options
author | Franck Bui <fbui@suse.com> | 2016-06-13 16:10:06 +0200 |
---|---|---|
committer | Franck Bui <fbui@suse.com> | 2016-06-20 18:40:51 +0200 |
commit | affd7ed1a923b0df8479cff1bd9eafb625fdaa66 (patch) | |
tree | a45ba92fef023e04fcb8bfb2638d2596802e3a44 /src/core | |
parent | 2065ca699b38d97b2a4ebd34a7c2d2c186970d20 (diff) |
pid1: reconnect to the console before being re-executed
When re-executed, reconnect the console to PID1's stdios as it was the case
when PID1 was initially started by the kernel.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/main.c b/src/core/main.c index 93098daa9b..cef7575937 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -1967,6 +1967,9 @@ finish: log_error_errno(r, "Failed to switch root, trying to continue: %m"); } + /* Reopen the console */ + (void) make_console_stdio(); + args_size = MAX(6, argc+1); args = newa(const char*, args_size); @@ -2018,9 +2021,6 @@ finish: arg_serialization = safe_fclose(arg_serialization); fds = fdset_free(fds); - /* Reopen the console */ - (void) make_console_stdio(); - for (j = 1, i = 1; j < (unsigned) argc; j++) args[i++] = argv[j]; args[i++] = NULL; |