]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/main: get rid from excess check of ACTION_TEST (#4350)
author0xAX <0xAX@users.noreply.github.com>
Tue, 11 Oct 2016 21:30:04 +0000 (00:30 +0300)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 11 Oct 2016 21:30:04 +0000 (17:30 -0400)
If `--test` command line option was passed, the systemd set skip_setup
to true during bootup. But after this we check again that arg_action is
test or help and opens pager depends on result.

We should skip setup in a case when `--test` is passed, but it is also
safe to set skip_setup in a case of `--help`. So let's remove first
check and move skip_setup = true to the second check.

src/core/main.c

index 4b82a57b3c8ef706d95bfe3d0a59f778ce2b5ccd..61f3828a369f96e5213bfa114d0191450c2fc05e 100644 (file)
@@ -1614,11 +1614,10 @@ int main(int argc, char *argv[]) {
                 goto finish;
         }
 
-        if (arg_action == ACTION_TEST)
-                skip_setup = true;
-
-        if (arg_action == ACTION_TEST || arg_action == ACTION_HELP)
+        if (arg_action == ACTION_TEST || arg_action == ACTION_HELP) {
                 pager_open(arg_no_pager, false);
+                skip_setup = true;
+        }
 
         if (arg_action == ACTION_HELP) {
                 retval = help();