]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
main: simplify arg_system initialization a bit 9263/head
authorLennart Poettering <lennart@poettering.net>
Wed, 13 Jun 2018 16:47:13 +0000 (18:47 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 13 Jun 2018 16:52:27 +0000 (18:52 +0200)
For both branches of the if check it's the first line, hence let's just
do it before.

src/core/main.c

index ad1ae591e1e3191f87e734e54b2dbc96c5e9a4ac..f396a61e1244f247c3aa20e91d3a2a0e426ee07d 100644 (file)
@@ -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();