mirror of
https://github.com/systemd/systemd.git
synced 2024-10-28 11:55:44 +03:00
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.
This commit is contained in:
parent
36cd739a78
commit
21f7a622d5
@ -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");
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user