1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-04 09:18:12 +03:00
This commit is contained in:
Itxaka 2024-12-30 22:22:37 -08:00 committed by GitHub
commit f394ee1de6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1783,13 +1783,13 @@ static void config_select_default_entry(Config *config) {
assert(config);
i = config_find_entry(config, config->entry_oneshot);
if (i != IDX_INVALID) {
if (i != IDX_INVALID || config->entries[i]->tries_left != 0) {
config->idx_default = i;
return;
}
i = config_find_entry(config, config->use_saved_entry_efivar ? config->entry_saved : config->entry_default_efivar);
if (i != IDX_INVALID) {
if (i != IDX_INVALID || config->entries[i]->tries_left != 0) {
config->idx_default = i;
config->idx_default_efivar = i;
return;
@ -1800,14 +1800,14 @@ static void config_select_default_entry(Config *config) {
i = config->use_saved_entry_efivar ? IDX_INVALID : config_find_entry(config, config->entry_saved);
else
i = config_find_entry(config, config->entry_default_config);
if (i != IDX_INVALID) {
if (i != IDX_INVALID || config->entries[i]->tries_left != 0) {
config->idx_default = i;
return;
}
/* select the first suitable entry */
for (i = 0; i < config->n_entries; i++)
if (config->entries[i]->type != LOADER_AUTO && !config->entries[i]->call) {
if (config->entries[i]->type != LOADER_AUTO && !config->entries[i]->call && config->entries[i]->tries_left != 0) {
config->idx_default = i;
return;
}