core: don't allow changing the slice of a unit while it is active
This commit is contained in:
parent
b821a397c0
commit
102ef9829e
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue