svn commit: r252672 - head/sbin/nvmecontrol

Jim Harris jim.harris at gmail.com
Tue Jul 9 21:18:13 UTC 2013


On Sat, Jul 6, 2013 at 7:26 PM, Bruce Evans <brde at 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


More information about the svn-src-all mailing list