Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Jul 2013 14:18:11 -0700
From:      Jim Harris <jim.harris@gmail.com>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek <pjd@freebsd.org>, Jilles Tjoelker <jilles@stack.nl>
Subject:   Re: svn commit: r252672 - head/sbin/nvmecontrol
Message-ID:  <CAJP=Hc_y7vHsRooDTQ=EZ2B2JtKtctpbFdZs=O_mObAJPgVdBA@mail.gmail.com>
In-Reply-To: <20130707114237.L897@besplex.bde.org>
References:  <201307040026.r640QOCd079203@svn.freebsd.org> <20130704105843.B982@besplex.bde.org> <20130706184249.GD25842@garage.freebsd.pl> <20130706195108.GA34684@stack.nl> <20130707114237.L897@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jul 6, 2013 at 7:26 PM, Bruce Evans <brde@optusnet.com.au> wrote:

> On Sat, 6 Jul 2013, Jilles Tjoelker wrote:
>
>  On Sat, Jul 06, 2013 at 08:42:49PM +0200, Pawel Jakub Dawidek wrote:
>>
>>> On Thu, Jul 04, 2013 at 11:44:28AM +1000, Bruce Evans wrote:
>>>
>>>> Many style bugs are visible in this patch:
>>>>
>>> [...]
>>>
>>>> - sysexits.h is used
>>>>
>>> [...]
>>>
>>
>>  Bruce, until sysexits(3) doesn't explicitly say it shouldn't be used,
>>> please stop calling this a bug, because you are just confusing people.
>>> At this point sysexits(3) actually even suggests it is blessed by
>>> style(9). This is how it starts:
>>>
>>
>>          According to style(9), it is not a good practice to call exit(3)
>>>         with arbitrary values to indicate a failure condition when
>>>         ending a program. Instead, the pre-defined exit codes from
>>>         sysexits should be used, so the caller of the process can get a
>>>         rough estimation about the failure class without looking up the
>>>         source code.
>>>
>>
> This is just another bug in sysexits(3).  This is not according to
> style(9), since style(9) was fixed to not say that after I complained
> previously :-).  It has never been normal practice to use sysexits(3),
> but someone who likes it added recommendations to use it to style(9) when
> they added the man pages for sysexits(3).  Before that, it was
> so rarely used that it had no man page.
>

To add to the areas of confusion already stated in this thread, err(3)
explicitly recommends using sysexits(3) and uses it in all of the examples.

I decided to use 0/1 instead of sysexits since it seems most appropriate
based on the discussion here and other examples in sbin.  I incorporated
these changes as well as addressing some of Bruce's other feedback in
r253109.

Thanks,

-Jim



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJP=Hc_y7vHsRooDTQ=EZ2B2JtKtctpbFdZs=O_mObAJPgVdBA>