unit: use ESRCH as error when we don't find anybody to kill

This commit is contained in:
Lennart Poettering
2011-07-13 19:59:28 +02:00
parent 0a524ba7c3
commit a17204af0e
4 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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)