summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/unit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index 64ab49dc4a..a43f1d7785 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -2441,6 +2441,9 @@ int unit_set_slice(Unit *u, Unit *slice) {
if (u->type == UNIT_SLICE)
return -EINVAL;
+ if (unit_active_state(u) != UNIT_INACTIVE)
+ return -EBUSY;
+
if (slice->type != UNIT_SLICE)
return -EINVAL;