diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index b7aebfe05bb0..256d70418e45 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -755,7 +755,10 @@ finish() tcsetattr (0, TCSANOW, &ts); } - exit(0); + if (nreceived) + exit(0); + else + exit(2); } #ifdef notdef