Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: othersrc/usr.bin/grep



"Nathan J. Williams" wrote:

> Chris Pinnock <cjep%NetBSD.org@localhost> writes:
> 
> > Log Message:
> > grep should exit with 2 on error. From OpenBSD.
> 
> Why? This disagrees with /usr/share/misc/style:
> 
>         /*
>          * Exits should be 0 on success, and 1 on failure.  Don't denote
>          * all the possible exit points, using the integers 1 through 300.
>          * Avoid obvious comments such as "Exit 0 on success."
>          */
> 
> Is there a compelling reason to use 2 instead of 1?

SUSv3 says:

    EXIT STATUS

     The following exit values shall be returned:
    0
          One or more lines were selected.
    1
          No lines were selected.
   >1
          An error occurred.

Simon.
--
Simon Burge                            <simonb%wasabisystems.com@localhost>
NetBSD Support and Service:         http://www.wasabisystems.com/



Home | Main Index | Thread Index | Old Index