summaryrefslogtreecommitdiff
path: root/src/core/swap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/swap.c')
-rw-r--r--src/core/swap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/swap.c b/src/core/swap.c
index cf33ab602e..13e12ad67a 100644
--- a/src/core/swap.c
+++ b/src/core/swap.c
@@ -196,6 +196,9 @@ static int swap_add_device_links(Swap *s) {
if (!s->what)
return 0;
+ if (!s->from_fragment)
+ return 0;
+
if (is_device_path(s->what))
return unit_add_node_link(UNIT(s), s->what, UNIT(s)->manager->running_as == SYSTEMD_SYSTEM);
else