]> granicus.if.org Git - procps-ng/commitdiff
pkill: fix error printing
authorSami Kerola <kerolasa@iki.fi>
Sat, 21 Jan 2012 01:09:48 +0000 (02:09 +0100)
committerSami Kerola <kerolasa@iki.fi>
Sat, 21 Jan 2012 11:15:40 +0000 (12:15 +0100)
Print correct pid number of process that was where not killed
because of kill was not successful. Incorrect behaviour before
this fix is bello.

-- snip
$ ps -elf | grep dh[c]
1 S root      1409     1  0  80   0 -  1782 poll_s 02:01 ?        00:00:00 dhclient wlan0
$ pkill dhc
pkill: killing pid 1 failed: Operation not permitted
-- snip

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
pgrep.c

diff --git a/pgrep.c b/pgrep.c
index 0c193093bf91be866dcd8d60e7fcf162d1dd3a65..65ca9060a116ee0b3983b670c4a7a7561725c2c2 100644 (file)
--- a/pgrep.c
+++ b/pgrep.c
@@ -779,7 +779,7 @@ int main (int argc, char **argv)
                        if (errno==ESRCH)
                                 // gone now, which is OK
                                continue;
-                       xwarn(_("killing pid %ld failed"));
+                       xwarn(_("killing pid %d failed"), procs[i].num);
                }
        } else {
                if (opt_count) {