From owner-freebsd-bugs Tue Dec 24 0:50: 9 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3476A37B445 for ; Tue, 24 Dec 2002 00:50:07 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id C9E5A43EEC for ; Tue, 24 Dec 2002 00:50:06 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id gBO8o6NS034600 for ; Tue, 24 Dec 2002 00:50:06 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id gBO8o6XO034596; Tue, 24 Dec 2002 00:50:06 -0800 (PST) Date: Tue, 24 Dec 2002 00:50:06 -0800 (PST) Message-Id: <200212240850.gBO8o6XO034596@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Tom Rhodes Subject: Re: bin/46501: Ping exits 2 when it should exit 1 Reply-To: Tom Rhodes Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/46501; it has been noted by GNATS. From: Tom Rhodes To: Maxim Konovalov Cc: spam-pr@silverwraith.com, bug-followup@FreeBSD.org Subject: Re: bin/46501: Ping exits 2 when it should exit 1 Date: Tue, 24 Dec 2002 03:47:25 -0500 On Tue, 24 Dec 2002 11:41:01 +0300 (MSK) Maxim Konovalov wrote: > On 23:30-0800, Dec 23, 2002, Avleen Vig wrote: > > > > Exit is already documented as 2, like the code. > > > This has been 2 for a long time now, why do you want to change it > > > all of a sudden? In my opinion this change isn't correct because > > > so many other utilities are using exit(2); also. > > > > Ping is documented as I stated in ping(8) as exiting 1 when it > > actually exits 2. > > From ping(8): > > RETURN VALUES > The ping utility returns an exit status of zero if at least one > response was heard from the specified host; a status of two if > the transmission > ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > ^^^^^^ > was successful but no responses were received; or another value > (from) if an error occurred. > > > I don't know of any other utils that exit(2) when they don't have > > somthing exiting 1 already. src/sbin/fsck src/sbin/mountd src/sbin/routed src/sbin/tunefs src/bin/sh src/sbin/savecore src/usr.sbin/usbd src/usr.sbin/fdcontrol src/usr.sbin/lpd all use exit(2); This seems common. > > It makes little sense to exit(2) when there's nothing in ping that > > will exit(1). > > > > Thus it makes sense to correct this. I don't believe "it haven't > > been changed for a long time" is a valid reason for leaving > > something broken/incorrect. > > > > If this won't be fixed, then the documentation needs to be fixed, > > but I don't feel that's correct. > > -- > Maxim Konovalov, maxim@FreeBSD.org > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message