]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: don't allow changing the slice of a unit while it is active
authorLennart Poettering <lennart@poettering.net>
Tue, 1 Sep 2015 16:53:29 +0000 (18:53 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 1 Sep 2015 16:53:29 +0000 (18:53 +0200)
src/core/unit.c

index 64ab49dc4ac6e0b2f00e517ce7a786fb7355a5f0..a43f1d77850987af13ac5177fe5298e95681b65b 100644 (file)
@@ -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;