bin/121165: pkg_add(1) prints a weird message: PKG_TMPDIR
environment variable to a location with at least 0 bytes
Bruce Evans
brde at optusnet.com.au
Wed Mar 24 18:35:24 UTC 2010
On Tue, 23 Mar 2010, Garrett Cooper wrote:
> On Tue, Mar 23, 2010 at 12:26 PM, Bruce Evans <brde at optusnet.com.au> wrote:
>> On Mon, 22 Mar 2010, Garrett Cooper wrote:
>>
>>> Functions as expected provided test added in
>>> http://p4web.freebsd.org/chv.cgi?CH=175930 ; I'm just making one minor
>>> 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
More information about the freebsd-bugs
mailing list