From 7358dc029ab8cb8f9d83eb847389d84f822ccfe8 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Thu, 30 Oct 2014 20:32:17 -0400 Subject: Convert the rest to sd_bus_errnomap I tried to preserve most errno values, but in some cases they were inconsistent (different errno values for the same error name) or just mismatched. --- src/core/unit.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/core/unit.c') diff --git a/src/core/unit.c b/src/core/unit.c index 84f210a312..d5acc728ec 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -2939,18 +2939,16 @@ int unit_kill_common( if (who == KILL_MAIN && main_pid <= 0) { if (main_pid < 0) - sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_PROCESS, "%s units have no main processes", unit_type_to_string(u->type)); + return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_PROCESS, "%s units have no main processes", unit_type_to_string(u->type)); else - sd_bus_error_set_const(error, BUS_ERROR_NO_SUCH_PROCESS, "No main process to kill"); - return -ESRCH; + 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 (control_pid < 0) - sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_PROCESS, "%s units have no control processes", unit_type_to_string(u->type)); + return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_PROCESS, "%s units have no control processes", unit_type_to_string(u->type)); else - sd_bus_error_set_const(error, BUS_ERROR_NO_SUCH_PROCESS, "No control process to kill"); - return -ESRCH; + return sd_bus_error_set_const(error, BUS_ERROR_NO_SUCH_PROCESS, "No control process to kill"); } if (who == KILL_CONTROL || who == KILL_ALL) -- cgit v1.2.3-54-g00ecf