Merge pull request #7387 from yuwata/fix-7370

core: load() should fail when the corresponding unit file does not exist
This commit is contained in:
Lennart Poettering 2017-11-20 12:51:40 +01:00 committed by GitHub
commit df8ca63396
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -224,7 +224,7 @@ static int automount_load(Unit *u) {
assert(u->load_state == UNIT_STUB);
/* Load a .automount file */
r = unit_load_fragment_and_dropin_optional(u);
r = unit_load_fragment_and_dropin(u);
if (r < 0)
return r;

View file

@ -292,7 +292,10 @@ static int swap_load(Unit *u) {
assert(u->load_state == UNIT_STUB);
/* Load a .swap file */
r = unit_load_fragment_and_dropin_optional(u);
if (SWAP(u)->from_proc_swaps)
r = unit_load_fragment_and_dropin_optional(u);
else
r = unit_load_fragment_and_dropin(u);
if (r < 0)
return r;