From owner-svn-src-all@FreeBSD.ORG Thu Jan 17 02:25:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 89BB8719; Thu, 17 Jan 2013 02:25:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id 16681134; Thu, 17 Jan 2013 02:25:22 +0000 (UTC) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r0H2PLkc005686; Thu, 17 Jan 2013 13:25:21 +1100 Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r0H2PCRf006526 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 17 Jan 2013 13:25:13 +1100 Date: Thu, 17 Jan 2013 13:25:12 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Xin LI Subject: Re: svn commit: r245506 - head/bin/pwait In-Reply-To: <201301161815.r0GIFQPk007553@svn.freebsd.org> Message-ID: <20130117130740.I1066@besplex.bde.org> References: <201301161815.r0GIFQPk007553@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=P/xiHV8u c=1 sm=1 a=jy4U5xBK6Z8A:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=0Iti9RnyFakA:10 a=TPjh7SLijXKq6PV6sMgA:9 a=CjuIK1q_8ugA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jan 2013 02:25:23 -0000 On Wed, 16 Jan 2013, Xin LI wrote: > Log: > Use a different way to silence clang analyzer as done in r245494 by > explicitly telling the compiler that we are on the exit route. > > X-MFC: together with r245494 > > Modified: > head/bin/pwait/pwait.c > > Modified: head/bin/pwait/pwait.c > ============================================================================== > --- head/bin/pwait/pwait.c Wed Jan 16 09:07:49 2013 (r245505) > +++ head/bin/pwait/pwait.c Wed Jan 16 18:15:25 2013 (r245506) > @@ -141,6 +141,5 @@ main(int argc, char *argv[]) > nleft -= n; > } > > - free(e); > - return 0; > + exit(EX_OK); > } This uses the sysexits mistake. style(9) was fixed to not give an example of this mistake. Before this, sysexits was used a whole once in pwait(1) (for EX_USAGE) in usage(). EX_USAGE happens to be 64. As usual when the mistake is used, this is useless for humans (the usage message gives more info) and unusable for programs, especially since it is undocmented (pwait(1)'s man page just says ">0 if an error occurs". It doesn't even use '.Std' for this, but hard-codes it. The related utilities for kill(1) and pkill(1) and their man pages are better. kill(1) doesn't use the mistake, and its man page uses '.Std'. pkill(1) doesn't use the mistake; it uses small integers for exit statuses, and its man page seems to document these correctly (it cannot use .Std since the exit status isn't standard). Bruce