]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootspec: move log msg from systemctl.c to bootspec.c
authorLennart Poettering <lennart@poettering.net>
Fri, 1 Mar 2019 15:53:11 +0000 (16:53 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 5 Mar 2019 15:50:58 +0000 (16:50 +0100)
find_default_boot_entry() is only used by systemctl.c, and currently
handles one log message in the caller instead of the callee. Let's
simplify that and move it over, too

src/shared/bootspec.c
src/systemctl/systemctl.c

index 53ab042404674a208dac87b21a134055cc751ff0..ae20b34a407226ca44839d7e921613adffab2daf 100644 (file)
@@ -1307,7 +1307,9 @@ int find_default_boot_entry(
         assert(e);
 
         r = find_esp_and_warn(esp_path, false, &esp_where, NULL, NULL, NULL, NULL);
-        if (r < 0)
+        if (r == -ENOKEY) /* find_esp_and_warn() doesn't warn about this case */
+                return log_error_errno(r, "Cannot find the ESP partition mount point.");
+        if (r < 0) /* But it logs about all these cases, hence don't log here again */
                 return r;
 
         r = find_xbootldr_and_warn(xbootldr_path, false, &xbootldr_where, NULL);
index 444d426eb05847b9da37b0acad65bedfc37c7478..0141e2995ded0ebdfcf6172fec930f8da3dceeaa 100644 (file)
@@ -3536,10 +3536,7 @@ static int load_kexec_kernel(void) {
                 return log_error_errno(errno, KEXEC" is not available: %m");
 
         r = find_default_boot_entry(NULL, NULL, &config, &e);
-        if (r == -ENOKEY) /* find_default_boot_entry() doesn't warn about this case */
-                return log_error_errno(r, "Cannot find the ESP partition mount point.");
         if (r < 0)
-                /* But it logs about all these cases, hence don't log here again */
                 return r;
 
         if (strv_length(e->initrd) > 1)