Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Mar 2010 05:35:20 +1100 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Garrett Cooper <yanefbsd@gmail.com>
Cc:        Garrett Cooper <yanegomi@gmail.com>, freebsd-bugs@freebsd.org, Bruce Evans <brde@optusnet.com.au>
Subject:   Re: bin/121165: pkg_add(1) prints a weird message: PKG_TMPDIR  environment variable to a location with at least 0 bytes
Message-ID:  <20100325052429.F739@besplex.bde.org>
In-Reply-To: <7d6fde3d1003231242i4c33fb1erbc5492a9d3db0219@mail.gmail.com>
References:  <201003220940.o2M9e21m037918@freefall.freebsd.org>  <20100324062626.C5129@delplex.bde.org> <7d6fde3d1003231242i4c33fb1erbc5492a9d3db0219@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--0-716436367-1269455720=:739
Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE

On Tue, 23 Mar 2010, Garrett Cooper wrote:

> On Tue, Mar 23, 2010 at 12:26 PM, Bruce Evans <brde@optusnet.com.au> wrot=
e:
>> On Mon, 22 Mar 2010, Garrett Cooper wrote:
>>
>>> =A0 =A0Functions as expected provided test added in
>>> http://p4web.freebsd.org/chv.cgi?CH=3D175930 ; I'm just making one mino=
r
>>> style change from the previous patch so that errx(3) in find_play_pen
>>> exits with EXIT_FAILURE instead of 2 (I agree that EXIT_FAILURE is
>>> synonymous to 2, but for it's more readable and consistent as
>>> EXIT_FAILURE).
>>
>> EXIT_FAILURE is 1.
>
> Excellent point -_-... should I just revert this then or leave it as-is?

Depends on whether distinguishing the exit code 2 from the exit code 1 is
important.  Normally it isn't, but sometimes 2 is documented and then at
least the documentation should be changed too.

BTW, I glanced at this because it looked a bit like use of sysexits and
I don't like sysexits.  But sysexits exit codes start at 64 and are
almost perfectly undocumented in utilities that use sysexits.  I don't
mind using the Standard C EXIT_SUCCESS and EXIT_FAILURE although these
are just aliases for 0 and 1 and these aliases are also almost perfectly
undocumented (most man pages use the mdoc macro ".Ex -std" which expands
to "The <foo> utility exits 0 on success, and >0 if an error occurs."
POSIX also mostly says 0/>0.  Thus the values in sysexits are allowed,
but know one knows what they mean.

Bruce
--0-716436367-1269455720=:739--



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