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
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);
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)