]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootspec: remove redundant logging
authorLennart Poettering <lennart@poettering.net>
Fri, 22 Jun 2018 17:26:22 +0000 (19:26 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 8 Oct 2018 19:40:44 +0000 (21:40 +0200)
boot_loader_read_conf(), boot_entries_find(), boot_entries_load_config()
all log their errors internally, hence no need to log a second or third
time about the same error when they return.

src/boot/bootctl.c
src/shared/bootspec.c

index 04ba8f7170b8b5ce64150aa269cb0b83111ec134..dfd24f4677ffa3b8580f3aeb763316037eabd06f 100644 (file)
@@ -272,8 +272,7 @@ static int status_entries(const char *esp_path, sd_id128_t partition) {
 
         r = boot_entries_load_config(esp_path, &config);
         if (r < 0)
-                return log_error_errno(r, "Failed to load bootspec config from \"%s/loader\": %m",
-                                       esp_path);
+                return r;
 
         if (config.default_entry < 0)
                 printf("%zu entries, no entry suitable as default\n", config.n_entries);
@@ -1013,8 +1012,7 @@ static int verb_list(int argc, char *argv[], void *userdata) {
 
         r = boot_entries_load_config(arg_path, &config);
         if (r < 0)
-                return log_error_errno(r, "Failed to load bootspec config from \"%s/loader\": %m",
-                                       arg_path);
+                return r;
 
         printf("Available boot entries:\n");
 
index 5d8471c51a88144b6eddeffd68e5d7b2ad3ec285..38123faa630313b17978f7d551b2c9adbe789175 100644 (file)
@@ -362,12 +362,12 @@ int boot_entries_load_config(const char *esp_path, BootConfig *config) {
         p = strjoina(esp_path, "/loader/loader.conf");
         r = boot_loader_read_conf(p, config);
         if (r < 0)
-                return log_error_errno(r, "Failed to read boot config from \"%s\": %m", p);
+                return r;
 
         p = strjoina(esp_path, "/loader/entries");
         r = boot_entries_find(p, &config->entries, &config->n_entries);
         if (r < 0)
-                return log_error_errno(r, "Failed to read boot entries from \"%s\": %m", p);
+                return r;
 
         r = boot_entries_uniquify(config->entries, config->n_entries);
         if (r < 0)