From 21f7a622d503708163817c7874210aa518ada412 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 22 Jun 2018 19:26:22 +0200 Subject: [PATCH] bootspec: remove redundant logging 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 | 6 ++---- src/shared/bootspec.c | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index 04ba8f7170..dfd24f4677 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -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"); diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index 5d8471c51a..38123faa63 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -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) -- 2.25.1