From: Zbigniew Jędrzejewski-Szmek Date: Tue, 5 Mar 2019 12:56:18 +0000 (+0100) Subject: shared/bootspec: minor simplification X-Git-Tag: v242-rc1~189^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f40999f87803cf456094ba42ca5f83d7bee059c4;p=thirdparty%2Fsystemd.git shared/bootspec: minor simplification --- diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index 39a7a97b128..59447d03b48 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -694,17 +694,12 @@ int boot_entries_load_config_auto( * want to. */ if (!override_esp_path && !override_xbootldr_path) { + if (access("/run/boot-loader-entries/", F_OK) >= 0) + return boot_entries_load_config("/run/boot-loader-entries/", NULL, config); - if (access("/run/boot-loader-entries/", F_OK) < 0) { - if (errno != ENOENT) - return log_error_errno(errno, "Failed to determine whether /run/boot-loader-entries/ exists: %m"); - } else { - r = boot_entries_load_config("/run/boot-loader-entries/", NULL, config); - if (r < 0) - return r; - - return 0; - } + if (errno != ENOENT) + return log_error_errno(errno, + "Failed to determine whether /run/boot-loader-entries/ exists: %m"); } r = find_esp_and_warn(override_esp_path, false, &esp_where, NULL, NULL, NULL, NULL); @@ -717,11 +712,7 @@ int boot_entries_load_config_auto( if (r < 0 && r != -ENOKEY) return r; /* It's fine if the XBOOTLDR partition doesn't exist, hence we ignore ENOKEY here */ - r = boot_entries_load_config(esp_where, xbootldr_where, config); - if (r < 0) - return r; - - return 0; + return boot_entries_load_config(esp_where, xbootldr_where, config); } int boot_entries_augment_from_loader(BootConfig *config, bool only_auto) {