From 3489b9343e8c94623344b6c7841d93e94c608e2c Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sat, 21 Jan 2012 02:09:48 +0100 Subject: [PATCH] pkill: fix error printing 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 --- pgrep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgrep.c b/pgrep.c index 0c193093..65ca9060 100644 --- 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) { -- 2.40.0