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:
parent
245fadf5db
commit
d275f8ea0a
@ -755,7 +755,10 @@ finish()
|
||||
tcsetattr (0, TCSANOW, &ts);
|
||||
}
|
||||
|
||||
exit(0);
|
||||
if (nreceived)
|
||||
exit(0);
|
||||
else
|
||||
exit(2);
|
||||
}
|
||||
|
||||
#ifdef notdef
|
||||
|
Loading…
Reference in New Issue
Block a user