]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootctl: return earlier with `--print-esp-path`
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Tue, 23 Jan 2024 09:24:44 +0000 (10:24 +0100)
committerAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Tue, 23 Jan 2024 09:24:44 +0000 (10:24 +0100)
`--print-esp-path` and `--print-boot-path` cannot be combined, so it's not
necessary to acquire the XBOOTLDR partition with `--print-esp-path`.

src/boot/bootctl-status.c

index 337b3eb4b557979b363bd771ba3927797ccc2e08..b8813ec40a6fc8e4af928eb67b72e100d9e9d161 100644 (file)
@@ -326,6 +326,7 @@ int verb_status(int argc, char *argv[], void *userdata) {
                         return r;
 
                 puts(arg_esp_path);
+                return 0;
         }
 
         r = acquire_xbootldr(/* unprivileged_mode= */ -1, &xbootldr_uuid, &xbootldr_devid);
@@ -340,10 +341,8 @@ int verb_status(int argc, char *argv[], void *userdata) {
                         return log_error_errno(SYNTHETIC_ERRNO(EACCES), "Failed to determine XBOOTLDR location: %m");
 
                 puts(path);
-        }
-
-        if (arg_print_esp_path || arg_print_dollar_boot_path)
                 return 0;
+        }
 
         r = 0; /* If we couldn't determine the path, then don't consider that a problem from here on, just
                 * show what we can show */