]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootctl: show 'Default Boot Entry' header only when we found something
authorLennart Poettering <lennart@poettering.net>
Fri, 22 Jun 2018 17:32:49 +0000 (19:32 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 8 Oct 2018 19:40:44 +0000 (21:40 +0200)
src/boot/bootctl.c

index dfd24f4677ffa3b8580f3aeb763316037eabd06f..6b08e3a2098cef39c89359e1ed8b398be9d2f89b 100644 (file)
@@ -264,21 +264,20 @@ static int status_variables(void) {
 }
 
 static int status_entries(const char *esp_path, sd_id128_t partition) {
-        int r;
-
         _cleanup_(boot_config_free) BootConfig config = {};
-
-        printf("Default Boot Entry:\n");
+        int r;
 
         r = boot_entries_load_config(esp_path, &config);
         if (r < 0)
                 return r;
 
         if (config.default_entry < 0)
-                printf("%zu entries, no entry suitable as default\n", config.n_entries);
+                printf("%zu entries, no entry could be determined as default.\n", config.n_entries);
         else {
                 const BootEntry *e = &config.entries[config.default_entry];
 
+                printf("Default Boot Entry:\n");
+
                 printf("        title: %s\n", boot_entry_title(e));
                 if (e->version)
                         printf("      version: %s\n", e->version);