mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 10:19:26 +00:00
Fix SIGINFO handling: do not print incorrect timing statistics
when the data for it is not available. Founded by: ping -s0 localhost; press ^T
This commit is contained in:
parent
d68d53d4d6
commit
aed98a27fd
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=115691
@ -1242,13 +1242,13 @@ check_status()
|
||||
|
||||
if (siginfo_p) {
|
||||
siginfo_p = 0;
|
||||
(void)fprintf(stderr,
|
||||
"\r%ld/%ld packets received (%.0f%%) %.3f min / %.3f avg / %.3f max\n",
|
||||
(void)fprintf(stderr, "\r%ld/%ld packets received (%.0f%%)",
|
||||
nreceived, ntransmitted,
|
||||
ntransmitted ? nreceived * 100.0 / ntransmitted : 0.0,
|
||||
nreceived ? tmin : 0.0,
|
||||
nreceived + nrepeats ? tsum / (nreceived + nrepeats) : tsum,
|
||||
tmax);
|
||||
ntransmitted ? nreceived * 100.0 / ntransmitted : 0.0);
|
||||
if (nreceived && timing)
|
||||
(void)fprintf(stderr, " %.3f min / %.3f avg / %.3f max",
|
||||
tmin, tsum / (nreceived + nrepeats), tmax);
|
||||
(void)fprintf(stderr, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user