diff options
Diffstat (limited to 'src/core/swap.c')
-rw-r--r-- | src/core/swap.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/core/swap.c b/src/core/swap.c index e44cffc2e8..ee0838e676 100644 --- a/src/core/swap.c +++ b/src/core/swap.c @@ -213,6 +213,9 @@ static int swap_add_device_links(Swap *s) { static int swap_add_default_dependencies(Swap *s) { assert(s); + if (!UNIT(s)->default_dependencies) + return 0; + if (UNIT(s)->manager->running_as != MANAGER_SYSTEM) return 0; @@ -331,11 +334,9 @@ static int swap_load(Unit *u) { if (r < 0) return r; - if (UNIT(s)->default_dependencies) { - r = swap_add_default_dependencies(s); - if (r < 0) - return r; - } + r = swap_add_default_dependencies(s); + if (r < 0) + return r; } return swap_verify(s); |