From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 13:28:11 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1698106564A; Tue, 2 Dec 2008 13:28:11 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1C7698FC1C; Tue, 2 Dec 2008 13:28:10 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c220-239-225-17.carlnfd1.nsw.optusnet.com.au [220.239.225.17]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id mB2DS7uo004699 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 3 Dec 2008 00:28:09 +1100 Date: Wed, 3 Dec 2008 00:28:07 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Sean C. Farley" In-Reply-To: Message-ID: <20081203001117.P1758@besplex.bde.org> References: <200811270842.mAR8gwi3080974@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Robert Watson Subject: Re: svn commit: r185362 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2008 13:28:11 -0000 On Sun, 30 Nov 2008, Sean C. Farley wrote: > On Thu, 27 Nov 2008, Robert Watson wrote: > >> Log: >> Revert r184509: don't encourage the use of sysexits.h with err() and >> errx(),, as there seems to be a general preference against this >> practice. > > *snip* > >> if ((four = malloc(sizeof(struct foo))) == NULL) >> - err(EX_OSERR, NULL); >> + err(1, (char *)NULL); >> if ((six = (int *)overflow()) == NULL) >> - errx(EX_DATAERR, "number overflowed"); >> + errx(1, "number overflowed"); > > Out of curiosity, why not EXIT_FAILURE instead of 1, at least in > situations where including stdlib.h is allowed? Is it because > EXIT_FAILURE is only required to be non-zero and not necessarily 1? It is because KNF doesn't use EXIT_FAILURE, and style(9) is primarily to document what KNF does and not to change it. Another bug in r184509 is that it didn't just encourage use of sysexits.h but required it, by removing all examples of non-use of sysexits.h. A non-example rule in style.9 still requires use of sysexits.h for all nonzero exits, but is obviously wrong since it is inconsistent with the 2 examples shown in the above diff. Bruce