]> granicus.if.org Git - procps-ng/commitdiff
skill: do not treat skill null parameter as 0
authorWANG Yunfeng <uhuruh@gmail.com>
Fri, 16 Oct 2009 10:39:31 +0000 (18:39 +0800)
committerCraig Small <csmall@enc.com.au>
Sun, 18 Dec 2011 11:51:32 +0000 (22:51 +1100)
A patch from Debian.

Bug-Debian: http://bugs.debian.org/551173
Backported-by: Sami Kerola <kerolasa@iki.fi>
skill.c

diff --git a/skill.c b/skill.c
index 66f042e247b652099bb9ae9fb7b55b501e9240b2..3a1d3167745984e04d8800c5661ccc032ccb14e2 100644 (file)
--- a/skill.c
+++ b/skill.c
@@ -306,7 +306,7 @@ no_more_args:
     long pid;
     char *endp;
     pid = strtol(argv[argc],&endp,10);
-    if(!*endp){
+    if(!*endp && (endp != argv[argc])){
       if(!kill((pid_t)pid,signo)) continue;
       // The UNIX standard contradicts itself. If at least one process
       // is matched for each PID (as if processes could share PID!) and