summaryrefslogtreecommitdiff
path: root/src/core/unit.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-10-30 20:32:17 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-10-30 20:38:28 -0400
commit7358dc029ab8cb8f9d83eb847389d84f822ccfe8 (patch)
treefb119a569229988b8dbf3408794d41ce0e229442 /src/core/unit.c
parent4a0a74179fcfb85c456794fd91fa2ae5d4d3bc8f (diff)
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.
Diffstat (limited to 'src/core/unit.c')
-rw-r--r--src/core/unit.c10
1 files changed, 4 insertions, 6 deletions
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)