From owner-freebsd-bugs Mon Dec 23 9:10: 4 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 CD34F37B401 for ; Mon, 23 Dec 2002 09:10:02 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E1C1043EDA for ; Mon, 23 Dec 2002 09:10:01 -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 gBNHA1NS057342 for ; Mon, 23 Dec 2002 09:10:01 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id gBNHA1Xq057340; Mon, 23 Dec 2002 09:10:01 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CBA2937B401 for ; Mon, 23 Dec 2002 09:09:54 -0800 (PST) Received: from guava.silverwraith.com (66-214-248-56.gln-eres.charterpipeline.net [66.214.248.56]) by mx1.FreeBSD.org (Postfix) with SMTP id D9BA543EDE for ; Mon, 23 Dec 2002 09:09:48 -0800 (PST) (envelope-from avleen@guava.silverwraith.com) Received: (qmail 46182 invoked by uid 0); 23 Dec 2002 17:09:37 -0000 Message-Id: <20021223170937.46181.qmail@guava.silverwraith.com> Date: 23 Dec 2002 17:09:37 -0000 From: Avleen Vig To: FreeBSD-gnats-submit@FreeBSD.org Cc: Avleen Vig X-Send-Pr-Version: 3.113 Subject: bin/46501: Ping exits 2 when it should exit 1 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 >Number: 46501 >Category: bin >Synopsis: Ping exits 2 when it should exit 1 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Dec 23 09:10:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Avleen Vig >Release: FreeBSD 4.7-STABLE i386 >Organization: none >Environment: System: FreeBSD guava.silverwraith.com 4.7-STABLE FreeBSD 4.7-STABLE #0: Sat Dec 21 16:30:53 PST 2002 root@guava.silverwraith.com:/usr/src/sys/compile/GUAVA i386 FreeBSD 4.7-STABLE as of Nov28th. >Description: The ping(8) manpage claims that if ping transmits packets but does not recieve a reply, it should exit one. However, it exits 2. Exiting 1 makes more sense than exiting 2, so I submit this patch. The bad code was put into ping in revision 1.4 on Nov 29 1994. >How-To-Repeat: ping -c1 -t1 1.2.3.4; echo $? >Fix: Apply this patch to src/sbin/ping/ping.c : --- ping.c.orig Mon Dec 23 08:51:56 2002 +++ ping.c Mon Dec 23 08:55:49 2002 @@ -1161,7 +1161,7 @@ if (nreceived) exit(0); else - exit(2); + exit(1); } #ifdef notdef >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message