From: Lennart Poettering Date: Tue, 1 Sep 2015 16:53:29 +0000 (+0200) Subject: core: don't allow changing the slice of a unit while it is active X-Git-Tag: v226~54^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=102ef9829ed72d3991cb73bc893880d715e667c5;p=thirdparty%2Fsystemd.git core: don't allow changing the slice of a unit while it is active --- diff --git a/src/core/unit.c b/src/core/unit.c index 64ab49dc4ac..a43f1d77850 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;