mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-03 01:12:51 +00:00
ping: Distinguish between timeouts and other failures.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
c248b6cfb1
commit
d3dc6f900a
|
@ -157,6 +157,7 @@ int main(int argc, char** argv)
|
||||||
printf("Pinging %s [%s] with %d bytes of data:\n", hostname, ip, l);
|
printf("Pinging %s [%s] with %d bytes of data:\n", hostname, ip, l);
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
|
SetLastError(0);
|
||||||
retval = IcmpSendEcho(icmp_file, ipaddr, send_data, l,
|
retval = IcmpSendEcho(icmp_file, ipaddr, send_data, l,
|
||||||
NULL, reply_buffer, reply_size, w);
|
NULL, reply_buffer, reply_size, w);
|
||||||
if (retval != 0)
|
if (retval != 0)
|
||||||
|
@ -177,7 +178,10 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("Request timed out.\n");
|
if (GetLastError() == IP_REQ_TIMED_OUT)
|
||||||
|
puts("Request timed out.");
|
||||||
|
else
|
||||||
|
puts("PING: transmit failed. General failure.");
|
||||||
lost++;
|
lost++;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
|
|
Loading…
Reference in a new issue