svn commit: r184509 - head/share/man/man9

Stanislav Sedov stas at FreeBSD.org
Sun Nov 30 23:47:46 PST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, 1 Nov 2008 22:05:41 +1100 (EST)
Bruce Evans <brde at optusnet.com.au> mentioned:

> On Fri, 31 Oct 2008, Robert Watson wrote:
> 
> > Log:
> >  In style(9) examples of err() and errx(), use sysexits(3) errors rather
> >  than returning 1.
> 
> style(9) was correct.  Using sysexits(3) is a style bug in most cases,
> especially in err() and errx() messages where there is a text message
> and not just a cryptic error code.  (Originally, in 4.4BSD, sysexits.3
> doesn't exist and /usr/src/admin/style/style had no mention of sysexits.h.
> What /usr/src/admin/style/style had was a rule to not label every error
> exit with a unique error code, since this gives a large undocumented
> set of program-specific error codes which no one remembers.  Using
> sysexits gives the same results in practice -- it gives a large
> documented set of generic error codes which no one remembers, so it
> was a bug to change the rule from disallowing lots of error codes to
> encouraging use of sysexits.  In 4.4BSD-Lite2, sysexits.3 still doesn't
> exist, and sysexits.h is only referred to in 11 .c files.  This shows
> that use of sysexits is very unusual in BSD code.  Some FreeBSD users
> like it and added it to style.9 and some FreeBSD .c files, so it is
> just unusual in FreeBSD code.)
> 

What is the benefit of using a single error exit code which theoretically
can't say anything about the type of the error instead of probably cryptic
set of documented error coded that could be later decrypted and analyzed
at least? For me the code using named error codes looks much cleaner, and
as all exit codes >0 threated as error, it seems that using sysexits codes
should not hurt. Do we totally againast them from now, or these exit codes
still could be used?

- -- 
Stanislav Sedov
ST4096-RIPE
-----BEGIN PGP SIGNATURE-----

iEYEARECAAYFAkkzlwAACgkQK/VZk+smlYHYyACffC6S9RSKNpHns8YXw6oycfBx
hB4Anj0Va8aZIM8SEPdAk3vir/2tO+mq
=PQc1
-----END PGP SIGNATURE-----


More information about the svn-src-all mailing list