This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Bug in /usr/bin/ping
- From: "Tom Van Looy" <assarix at pandora dot be>
- To: cygwin at cygwin dot com
- Date: Wed, 28 May 2008 10:11:30 +0000
- Subject: Bug in /usr/bin/ping
- Reply-to: assarix at pandora dot be
- Sensitivity: Normal
Hi
/usr/bin/ping does not return the correct return code on ping failure.
See example below, the .8 host does not exist, .9 does exist:
$ ping 56 1 192.168.20.9 > /dev/null ; echo $?
0
$ ping 56 1 192.168.20.8 > /dev/null ; echo $?
0
I checked Linux and Windows versions of ping and they work correctly.
$ ping -c 1 192.168.20.8 > /dev/null ; echo $?
1
$ ping -c 1 192.168.20.9 > /dev/null ; echo $?
0
$ /cygdrive/c/WINDOWS/system32/ping.exe -n 1 \
> 192.168.20.8 > /dev/null ; echo $?
1
$ /cygdrive/c/WINDOWS/system32/ping.exe -n 1 \
> 192.168.20.9 > /dev/null ; echo $?
0
I didn't look into the ping source, so no diff ...
I just aliased ping with the windows version as a workaround.
Kind regards,
Tom Van Looy
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/