]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootctl: don't accidentally propagate errors in "bootctl status"
authorLennart Poettering <lennart@poettering.net>
Wed, 9 Sep 2020 21:04:17 +0000 (23:04 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 10 Sep 2020 10:45:54 +0000 (12:45 +0200)
Fixes: #16989
src/boot/bootctl.c

index 94bd1788f8d230f4ad9e59ff5dc89aa502af90f5..4c84421f22f1e9787e8937c5f551ca257a3fad27 100644 (file)
@@ -1231,15 +1231,15 @@ static int verb_status(int argc, char *argv[], void *userdata) {
                 printf("  Secure Boot: %sd\n", enable_disable(is_efi_secure_boot()));
                 printf("   Setup Mode: %s\n", is_efi_secure_boot_setup_mode() ? "setup" : "user");
 
-                r = efi_get_reboot_to_firmware();
-                if (r > 0)
+                k = efi_get_reboot_to_firmware();
+                if (k > 0)
                         printf(" Boot into FW: %sactive%s\n", ansi_highlight_yellow(), ansi_normal());
-                else if (r == 0)
+                else if (k == 0)
                         printf(" Boot into FW: supported\n");
-                else if (r == -EOPNOTSUPP)
+                else if (k == -EOPNOTSUPP)
                         printf(" Boot into FW: not supported\n");
                 else {
-                        errno = -r;
+                        errno = -k;
                         printf(" Boot into FW: %sfailed%s (%m)\n", ansi_highlight_red(), ansi_normal());
                 }
                 printf("\n");