summaryrefslogtreecommitdiff
path: root/src/core/unit.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-08-28 18:29:02 +0200
committerLennart Poettering <lennart@poettering.net>2015-08-31 13:20:43 +0200
commit52f448c3fff64752649af4b8be5260c1a8a105ea (patch)
tree490ea7224efc5982f2863ec045f65226391d8607 /src/core/unit.c
parent9797f89bf0ec75a60066b162ab7c23dfb8e734e7 (diff)
unit: minor simplification
Diffstat (limited to 'src/core/unit.c')
-rw-r--r--src/core/unit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index 9afb5736d7..5f602bdf5f 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -3135,17 +3135,17 @@ int unit_kill_common(
int r = 0;
- if (who == KILL_MAIN && main_pid <= 0) {
+ if (who == KILL_MAIN) {
if (main_pid < 0)
return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_PROCESS, "%s units have no main processes", unit_type_to_string(u->type));
- else
+ else if (main_pid == 0)
return sd_bus_error_set_const(error, BUS_ERROR_NO_SUCH_PROCESS, "No main process to kill");
}
- if (who == KILL_CONTROL && control_pid <= 0) {
+ if (who == KILL_CONTROL) {
if (control_pid < 0)
return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_PROCESS, "%s units have no control processes", unit_type_to_string(u->type));
- else
+ else if (control_pid == 0)
return sd_bus_error_set_const(error, BUS_ERROR_NO_SUCH_PROCESS, "No control process to kill");
}