diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-06-13 18:47:13 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-06-13 18:52:27 +0200 |
commit | b5752d23521fddb3753291f58d1dbd4427cc2445 (patch) | |
tree | d24107c66914bcd67009ee03d37b5754009a8893 | |
parent | pid1: preserve current value of log target across re-{load,execution} (diff) | |
download | systemd-b5752d23521fddb3753291f58d1dbd4427cc2445.tar.xz systemd-b5752d23521fddb3753291f58d1dbd4427cc2445.zip |
main: simplify arg_system initialization a bit
For both branches of the if check it's the first line, hence let's just
do it before.
-rw-r--r-- | src/core/main.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/main.c b/src/core/main.c index ad1ae591e1..f396a61e12 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -2188,6 +2188,9 @@ int main(int argc, char *argv[]) { log_set_upgrade_syslog_to_journal(true); if (getpid_cached() == 1) { + /* When we run as PID 1 force system mode */ + arg_system = true; + /* Disable the umask logic */ umask(0); @@ -2204,7 +2207,6 @@ int main(int argc, char *argv[]) { if (detect_container() <= 0) { /* Running outside of a container as PID 1 */ - arg_system = true; log_set_target(LOG_TARGET_KMSG); log_open(); @@ -2243,7 +2245,6 @@ int main(int argc, char *argv[]) { } else { /* Running inside a container, as PID 1 */ - arg_system = true; log_set_target(LOG_TARGET_CONSOLE); log_open(); |