]> granicus.if.org Git - procps-ng/commitdiff
kill: report error if cannot kill process
authorCraig Small <csmall@enc.com.au>
Sat, 2 Jul 2016 02:25:14 +0000 (12:25 +1000)
committerCraig Small <csmall@enc.com.au>
Sat, 2 Jul 2016 02:25:14 +0000 (12:25 +1000)
Shell kill would report a problem if you tried to kill a process
while procps kill was silent. This meant it looked like kill worked
when it actually failed.

References:
 https://bugs.debian.org/733172

NEWS
skill.c

diff --git a/NEWS b/NEWS
index d04b42e1c126a554522cca8600d699ccfbc30ede..ef62e0f2412e16eb3fac4ff7711b39c79763ab3b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ procps-ng-NEXT
   * ps: Fallback to attr/current for context Debian #786956
   * tests: Conditionally add prctl Debian #816237
   * pidof: check cmd if space in argv0. GitLab #4
+  * kill: report error if cannot kill process #733172
 
 procps-ng-3.3.11
 ----------------
diff --git a/skill.c b/skill.c
index 914752759d5e7089b6bbbaa4ac93644223994092..53be72ddd04516350622c77b07ad8fbf8512f7d3 100644 (file)
--- a/skill.c
+++ b/skill.c
@@ -500,6 +500,7 @@ static void __attribute__ ((__noreturn__))
                pid = strtol_or_err(argv[i], _("failed to parse argument"));
                if (!kill((pid_t) pid, signo))
                        continue;
+        error(0, errno, "(%d)", pid);
                exitvalue = EXIT_FAILURE;
                continue;
        }