From: Lennart Poettering Date: Fri, 1 Mar 2019 15:53:11 +0000 (+0100) Subject: bootspec: move log msg from systemctl.c to bootspec.c X-Git-Tag: v242-rc1~192^2~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7800322ca553f62058a9dd57a747f3a637ea8827;p=thirdparty%2Fsystemd.git 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 --- diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index 53ab0424046..ae20b34a407 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -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); diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 444d426eb05..0141e2995de 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -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)