From: Lennart Poettering Date: Wed, 13 Jun 2018 16:47:13 +0000 (+0200) Subject: main: simplify arg_system initialization a bit X-Git-Tag: v239~64^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F9263%2Fhead;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/core/main.c b/src/core/main.c index ad1ae591e1e..f396a61e124 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();