core: don't allow changing the slice of a unit while it is active

This commit is contained in:
Lennart Poettering 2015-09-01 18:53:29 +02:00
parent b821a397c0
commit 102ef9829e
1 changed files with 3 additions and 0 deletions

View 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;