Subject: Re: CVS commit: othersrc/usr.bin/grep
To: Nathan J. Williams <nathanw@wasabisystems.com>
From: Simon Burge <simonb@wasabisystems.com>
List: source-changes
Date: 07/21/2003 01:58:15
"Nathan J. Williams" wrote:
> Chris Pinnock <cjep@NetBSD.org> 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>
NetBSD Support and Service: http://www.wasabisystems.com/