In past releases of FreeBSD, I have used the exit status of "ping" to

determine whether a connection to a given machine is up or not.

In FreeBSD 2.0 (and therefore, I assume, BSD 4.4) the exit code of ping
is always zero, even if no packets were received.

I would like to propose the following change to /usr/src/sbin/ping/ping.c
to restore this useful behaviour:

Submitted by:	Denis Fortin
This commit is contained in:
David Greenman 1994-11-29 16:09:56 +00:00
parent 8580379053
commit 6e1173dc29
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=4862

View File

@ -755,7 +755,10 @@ finish()
tcsetattr (0, TCSANOW, &ts);
}
exit(0);
if (nreceived)
exit(0);
else
exit(2);
}
#ifdef notdef