From 102ef9829ed72d3991cb73bc893880d715e667c5 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 1 Sep 2015 18:53:29 +0200 Subject: core: don't allow changing the slice of a unit while it is active --- src/core/unit.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/core') 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; -- cgit v1.2.3-54-g00ecf