summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-01 18:53:29 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-01 18:53:29 +0200
commit102ef9829ed72d3991cb73bc893880d715e667c5 (patch)
treecdff51f2cd2b249058ae2f7a22c68c6a8d0033e0 /src/core
parentb821a397c0fd382266a6018c1b6738ced69f8041 (diff)
core: don't allow changing the slice of a unit while it is active
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;