unit: use ESRCH as error when we don't find anybody to kill
This commit is contained in:
+2
-2
@@ -1769,12 +1769,12 @@ static int mount_kill(Unit *u, KillWho who, KillMode mode, int signo, DBusError
|
||||
|
||||
if (who == KILL_MAIN) {
|
||||
dbus_set_error(error, BUS_ERROR_NO_SUCH_PROCESS, "Mount units have no main processes");
|
||||
return -EINVAL;
|
||||
return -ESRCH;
|
||||
}
|
||||
|
||||
if (m->control_pid <= 0 && who == KILL_CONTROL) {
|
||||
dbus_set_error(error, BUS_ERROR_NO_SUCH_PROCESS, "No control process to kill");
|
||||
return -ENOENT;
|
||||
return -ESRCH;
|
||||
}
|
||||
|
||||
if (who == KILL_CONTROL || who == KILL_ALL)
|
||||
|
||||
+2
-2
@@ -3262,12 +3262,12 @@ static int service_kill(Unit *u, KillWho who, KillMode mode, int signo, DBusErro
|
||||
|
||||
if (s->main_pid <= 0 && who == KILL_MAIN) {
|
||||
dbus_set_error(error, BUS_ERROR_NO_SUCH_PROCESS, "No main process to kill");
|
||||
return -EINVAL;
|
||||
return -ESRCH;
|
||||
}
|
||||
|
||||
if (s->control_pid <= 0 && who == KILL_CONTROL) {
|
||||
dbus_set_error(error, BUS_ERROR_NO_SUCH_PROCESS, "No control process to kill");
|
||||
return -ENOENT;
|
||||
return -ESRCH;
|
||||
}
|
||||
|
||||
if (who == KILL_CONTROL || who == KILL_ALL)
|
||||
|
||||
+2
-2
@@ -2022,12 +2022,12 @@ static int socket_kill(Unit *u, KillWho who, KillMode mode, int signo, DBusError
|
||||
|
||||
if (who == KILL_MAIN) {
|
||||
dbus_set_error(error, BUS_ERROR_NO_SUCH_PROCESS, "Socket units have no main processes");
|
||||
return -EINVAL;
|
||||
return -ESRCH;
|
||||
}
|
||||
|
||||
if (s->control_pid <= 0 && who == KILL_CONTROL) {
|
||||
dbus_set_error(error, BUS_ERROR_NO_SUCH_PROCESS, "No control process to kill");
|
||||
return -ENOENT;
|
||||
return -ESRCH;
|
||||
}
|
||||
|
||||
if (who == KILL_CONTROL || who == KILL_ALL)
|
||||
|
||||
+2
-2
@@ -1278,12 +1278,12 @@ static int swap_kill(Unit *u, KillWho who, KillMode mode, int signo, DBusError *
|
||||
|
||||
if (who == KILL_MAIN) {
|
||||
dbus_set_error(error, BUS_ERROR_NO_SUCH_PROCESS, "Swap units have no main processes");
|
||||
return -EINVAL;
|
||||
return -ESRCH;
|
||||
}
|
||||
|
||||
if (s->control_pid <= 0 && who == KILL_CONTROL) {
|
||||
dbus_set_error(error, BUS_ERROR_NO_SUCH_PROCESS, "No control process to kill");
|
||||
return -ENOENT;
|
||||
return -ESRCH;
|
||||
}
|
||||
|
||||
if (who == KILL_CONTROL || who == KILL_ALL)
|
||||
|
||||
Reference in New Issue
Block a user