]> err.no Git - systemd/commitdiff
unit: use ESRCH as error when we don't find anybody to kill
authorLennart Poettering <lennart@poettering.net>
Wed, 13 Jul 2011 17:57:36 +0000 (19:57 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 13 Jul 2011 17:59:28 +0000 (19:59 +0200)
src/mount.c
src/service.c
src/socket.c
src/swap.c

index d837041475ac1ac762e3dbfe6fc097798a1369af..d26d45f038843148f556a86609e1b997a3e8ed02 100644 (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)
index 0b657679f7391fe4f630ba1f0e48f2dd46f10af8..646c0939067f8d57ef2727c0d5f082676ad63e06 100644 (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)
index 3a7aa94036d6123ab16c9cc7306f5af71b6a08f4..64d1028d4f1e42f90ba440fcbdde1a0f588bbaa8 100644 (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)
index a0b16776457e0c887964c1aa24df112236e61d76..6e41f9b68e59399adda22a0db3ff093bb01d394c 100644 (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)