Date: 23 Dec 2002 17:09:37 -0000 From: Avleen Vig <spam-pr@silverwraith.com> To: FreeBSD-gnats-submit@FreeBSD.org Cc: Avleen Vig <spam-pr@silverwraith.com> Subject: bin/46501: Ping exits 2 when it should exit 1 Message-ID: <20021223170937.46181.qmail@guava.silverwraith.com>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021223170937.46181.qmail>
