bootspec: it's fine if loader.conf is absent
We shouldn't generate an error in that case, as the file is optional.
This commit is contained in:
parent
0de2e1fd2e
commit
f91ed3dc81
|
@ -153,8 +153,12 @@ static int boot_loader_read_conf(const char *path, BootConfig *config) {
|
||||||
assert(config);
|
assert(config);
|
||||||
|
|
||||||
f = fopen(path, "re");
|
f = fopen(path, "re");
|
||||||
if (!f)
|
if (!f) {
|
||||||
|
if (errno == ENOENT)
|
||||||
|
return 0;
|
||||||
|
|
||||||
return log_error_errno(errno, "Failed to open \"%s\": %m", path);
|
return log_error_errno(errno, "Failed to open \"%s\": %m", path);
|
||||||
|
}
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
_cleanup_free_ char *buf = NULL, *field = NULL;
|
_cleanup_free_ char *buf = NULL, *field = NULL;
|
||||||
|
@ -204,7 +208,7 @@ static int boot_loader_read_conf(const char *path, BootConfig *config) {
|
||||||
return log_error_errno(r, "%s:%u: Error while reading: %m", path, line);
|
return log_error_errno(r, "%s:%u: Error while reading: %m", path, line);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int boot_entry_compare(const BootEntry *a, const BootEntry *b) {
|
static int boot_entry_compare(const BootEntry *a, const BootEntry *b) {
|
||||||
|
|
Loading…
Reference in a new issue