1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-10 01:17:44 +03:00

bootspec: move log msg from systemctl.c to bootspec.c

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
This commit is contained in:
Lennart Poettering 2019-03-01 16:53:11 +01:00
parent 4629499e7f
commit 7800322ca5
2 changed files with 3 additions and 4 deletions

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

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