diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-09-01 18:53:29 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-09-01 18:53:29 +0200 |
commit | 102ef9829ed72d3991cb73bc893880d715e667c5 (patch) | |
tree | cdff51f2cd2b249058ae2f7a22c68c6a8d0033e0 /src/core/unit.c | |
parent | b821a397c0fd382266a6018c1b6738ced69f8041 (diff) |
core: don't allow changing the slice of a unit while it is active
Diffstat (limited to 'src/core/unit.c')
-rw-r--r-- | src/core/unit.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; |