From: Yu Watanabe Date: Sun, 19 Nov 2017 16:00:34 +0000 (+0900) Subject: core/swap: load() should fail when neither of corresponding unit file nor /proc/swap... X-Git-Tag: v236~175^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7387%2Fhead;p=thirdparty%2Fsystemd.git core/swap: load() should fail when neither of corresponding unit file nor /proc/swap entry does not exist It is not necessary to label as loaded to a swap unit when neither of corresponding unit file nor entry in /proc/swap does not exist. This makes swap_load() to fail such a case. Partially fixes #7370. --- diff --git a/src/core/swap.c b/src/core/swap.c index cfe9d91cedb..f37a81f56c7 100644 --- a/src/core/swap.c +++ b/src/core/swap.c @@ -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;