http://perforce.freebsd.org/chv.cgi?CH=72968 Change 72968 by pjd@pjd_anger on 2005/03/12 13:08:30 Fix a bug in '-n' option. This option gives us the most recently created process, but this process is pgrep/pkill itself and because pgrep/pkill skips itself later, it always returns nothing. So when looking for the newest process, skip myself. Affected files ... .. //depot/user/pjd/pkill/usr.bin/pkill/pkill.c#7 edit Differences ... ==== //depot/user/pjd/pkill/usr.bin/pkill/pkill.c#7 (text+ko) ==== @@ -436,6 +436,8 @@ bestidx = -1; for (i = 0, kp = plist; i < nproc; i++, kp++) { + if (kp->ki_pid == mypid) + continue; if (!selected[i]) continue;