Date: Sun, 1 Feb 1998 15:50:00 -0800 (PST) From: Bill Fenner <fenner@parc.xerox.com> To: freebsd-bugs Subject: Re: bin/5596: killall's bogus diagnostics Message-ID: <199802012350.PAA29319@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/5596; it has been noted by GNATS. From: Bill Fenner <fenner@parc.xerox.com> To: Wolfram Schneider <wosch@cs.tu-berlin.de> Cc: freebsd-gnats-submit@hub.freebsd.org, mi@aldan.algebra.com Subject: Re: bin/5596: killall's bogus diagnostics Date: Sun, 1 Feb 1998 15:48:21 PST Ah, but it might be nice to change the diagnostic if there were no matching processes owned by you; something like this patch? Bill --- killall.pl.orig Sun Feb 1 15:42:15 1998 +++ killall.pl Sun Feb 1 15:45:08 1998 @@ -85,16 +85,22 @@ $proc[$PROC_RUID], $proc[$PROC_NAME] if $debug > 1; if ( # match program name - ($proc[$PROC_NAME] eq $program || - ($match && $proc[$PROC_NAME] =~ /$programMatch/oi) - ) && - # id test - ($proc[$PROC_EUID] eq $id || # effective uid - $proc[$PROC_RUID] eq $id || # real uid - !$id)) # root + $proc[$PROC_NAME] eq $program || + ($match && $proc[$PROC_NAME] =~ /$programMatch/oi) + ) { - push(@kill, $pid); - $thiskill++; + if ( # id test + $proc[$PROC_EUID] eq $id || # effective uid + $proc[$PROC_RUID] eq $id || # real uid + !$id) # root + { + push(@kill, $pid); + $thiskill++; + } + else + { + $noperm++; + } } } close STATUS; @@ -102,7 +108,13 @@ closedir PROCFS; # nothing found - warn "No matching processes ``$program''\n" unless $thiskill; + if (!$thiskill) { + if ($noperm) { + warn "No matching processes ``$program'' belonging to you\n"; + } else { + warn "No matching processes ``$program''\n"; + } + } } # nothing found
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199802012350.PAA29319>