Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jul 2010 16:50:02 GMT
From:      dfilter@FreeBSD.ORG (dfilter service)
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/40282: commit references a PR
Message-ID:  <201007291650.o6TGo2hm058126@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/40282; it has been noted by GNATS.

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/40282: commit references a PR
Date: Thu, 29 Jul 2010 16:40:55 +0000 (UTC)

 Author: jilles
 Date: Thu Jul 29 16:40:45 2010
 New Revision: 210613
 URL: http://svn.freebsd.org/changeset/base/210613
 
 Log:
   kill: Stop processing if a syntactically invalid pid is encountered.
   
   So a command like
     kill _HUP 1
   now fails without sending SIGTERM to init.
   
   The behaviour when kill(2) fails remains unchanged: processing continues.
   This matches other implementations and POSIX and is useful for killing
   multiple processes at once when some of them may already be gone.
   
   PR:		bin/40282
 
 Modified:
   head/bin/kill/kill.c
 
 Modified: head/bin/kill/kill.c
 ==============================================================================
 --- head/bin/kill/kill.c	Thu Jul 29 16:30:27 2010	(r210612)
 +++ head/bin/kill/kill.c	Thu Jul 29 16:40:45 2010	(r210613)
 @@ -123,10 +123,9 @@ main(int argc, char *argv[])
  
  	for (errors = 0; argc; argc--, argv++) {
  		pid = strtol(*argv, &ep, 10);
 -		if (!**argv || *ep) {
 -			warnx("illegal process id: %s", *argv);
 -			errors = 1;
 -		} else if (kill(pid, numsig) == -1) {
 +		if (!**argv || *ep)
 +			errx(1, "illegal process id: %s", *argv);
 +		else if (kill(pid, numsig) == -1) {
  			warn("%s", *argv);
  			errors = 1;
  		}
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007291650.o6TGo2hm058126>