]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/bootspec: minor simplification
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 5 Mar 2019 12:56:18 +0000 (13:56 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 6 Mar 2019 21:21:34 +0000 (22:21 +0100)
src/shared/bootspec.c

index 39a7a97b1286dbb77f4ffb240568c94669ec5a55..59447d03b4874ddb405a7783f549ce9eadb81c70 100644 (file)
@@ -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) {