From: Lennart Poettering Date: Mon, 4 Mar 2019 16:57:54 +0000 (+0100) Subject: bootspec: rework find_default_boot_entry() to use boot_entries_load_config_auto() X-Git-Tag: v242-rc1~192^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1a877199635cdd340ba3ce3a7725471691d189c;p=thirdparty%2Fsystemd.git bootspec: rework find_default_boot_entry() to use boot_entries_load_config_auto() it's pretty much the same code now, hence use it. --- diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index c6aa2c0f8bf..4e73e6d4abf 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -1416,25 +1416,14 @@ int find_default_boot_entry( BootConfig *config, const BootEntry **e) { - _cleanup_free_ char *esp_where = NULL, *xbootldr_where = NULL; int r; assert(config); assert(e); - r = find_esp_and_warn(NULL, false, &esp_where, NULL, NULL, NULL, NULL); - 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(NULL, false, &xbootldr_where, NULL); - if (r < 0 && r != -ENOKEY) - return r; - - r = boot_entries_load_config(esp_where, xbootldr_where, config); + r = boot_entries_load_config_auto(NULL, NULL, config); if (r < 0) - return log_error_errno(r, "Failed to load boot loader entries: %m"); + return r; if (config->default_entry < 0) return log_error_errno(SYNTHETIC_ERRNO(ENOENT),