From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 07:47:46 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6221A1065670; Mon, 1 Dec 2008 07:47:46 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mr0.ht-systems.ru (mr0.ht-systems.ru [78.110.50.55]) by mx1.freebsd.org (Postfix) with ESMTP id D01F08FC08; Mon, 1 Dec 2008 07:47:45 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from [85.21.245.235] (helo=orion.SpringDaemons.com) by smtp.ht-systems.ru with esmtpa (Exim 4.62) (envelope-from ) id 1L73VP-0008Cy-MZ; Mon, 01 Dec 2008 10:47:43 +0300 Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id 64004398F4; Mon, 1 Dec 2008 10:49:20 +0300 (MSK) Date: Mon, 1 Dec 2008 10:49:20 +0300 From: Stanislav Sedov To: Bruce Evans Message-Id: <20081201104920.4b001553.stas@FreeBSD.org> In-Reply-To: <20081101212937.D12448@delplex.bde.org> References: <200810311447.m9VElFtp083250@svn.freebsd.org> <20081101212937.D12448@delplex.bde.org> Organization: The FreeBSD Project X-XMPP: ssedov@jabber.ru X-Voice: +7 916 849 20 23 X-PGP-Fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Robert Watson Subject: Re: svn commit: r184509 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2008 07:47:46 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sat, 1 Nov 2008 22:05:41 +1100 (EST) Bruce Evans 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-----