diff options
| author | Bjoern A. Zeeb <bz@FreeBSD.org> | 2008-08-02 13:14:35 +0000 |
|---|---|---|
| committer | Bjoern A. Zeeb <bz@FreeBSD.org> | 2008-08-02 13:14:35 +0000 |
| commit | 38ae41901b9aa9476b807a0090af9b3d9f15f03c (patch) | |
| tree | 27271468a22577a384126b3e2be630b7dd47966d | |
| parent | 4e0b2f18a7e10b5d729950bf4103ac1b04e2e190 (diff) | |
Notes
| -rw-r--r-- | sbin/ping6/ping6.8 | 6 | ||||
| -rw-r--r-- | sbin/ping6/ping6.c | 7 |
2 files changed, 9 insertions, 4 deletions
diff --git a/sbin/ping6/ping6.8 b/sbin/ping6/ping6.8 index 89a81684cf55..2830238a585f 100644 --- a/sbin/ping6/ping6.8 +++ b/sbin/ping6/ping6.8 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 17, 1998 +.Dd May 27, 2008 .Dt PING6 8 .Os .Sh NAME @@ -407,7 +407,9 @@ option of The .Nm utility returns 0 on success (the host is alive), -and non-zero if the arguments are incorrect or the host is not responding. +2 if the transmission was successful but no responses were received, +any other non-zero value if the arguments are incorrect or +another error has occured. .Sh EXAMPLES Normally, .Nm diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c index a7ab9a1f3e8a..14b30fc27cc2 100644 --- a/sbin/ping6/ping6.c +++ b/sbin/ping6/ping6.c @@ -1070,6 +1070,9 @@ main(argc, argv) /* signal handling */ if (seenalrm) { + /* last packet sent, timeout reached? */ + if (npackets && ntransmitted >= npackets) + break; retransmit(); seenalrm = 0; continue; @@ -1168,7 +1171,7 @@ main(argc, argv) break; } summary(); - exit(nreceived == 0); + exit(nreceived == 0 ? 2 : 0); } void @@ -1219,7 +1222,7 @@ retransmit() itimer.it_interval.tv_usec = 0; itimer.it_value.tv_usec = 0; - (void)signal(SIGALRM, onint); + (void)signal(SIGALRM, onsignal); (void)setitimer(ITIMER_REAL, &itimer, NULL); } |
