aboutsummaryrefslogtreecommitdiff
path: root/lib/isc/ia64/(developers-only)
diff options
context:
space:
mode:
authorOlivier Certner <olce@FreeBSD.org>2026-04-02 19:13:02 +0000
committerOlivier Certner <olce@FreeBSD.org>2026-04-07 09:23:09 +0000
commit31749859525b2b79634dc7c066c3563be5b1e3fd (patch)
tree53c3ab77f19da751cb1dce10e44c8f95a7b6bc76 /lib/isc/ia64/(developers-only)
parent00d96da231d007673a1672452748d8ea4f6788ae (diff)
netstat(1): '-w': Banners to appear before a new statistics line, not afterHEADmain
Recurring banners except the first are printed just after the latest interval's statistics line, giving the false impression that the latter are omitted. It is also better to print a new banner only if it is going to be followed by a new line of statistics, in case netstat(1) is interrupted or we have reached the number of iterations specified by '-q'. Fix this by pushing printing these banners inside the loop producing statistics lines, after having waited for the next interval. The first banner is printed before the loop, as we want it to be printed immediately at launch, even if at this point we do not have statistics to display (we have to wait for an interval to compute these, as they are based on a difference). While here, remove the 'goto' spaghetti by putting banner printing into its own private function and using a proper infinite loop in sidewaysintpr(). While here, document the why of the 21 statistics line span between two banners. While here, check for the number of output lines of statistics once such a line has effectively been printed. This allows to remove the internal incrementation performed when reading '-w''s argument, which was a hack to compensate the misplaced check. While here, in the manual page, simplify the description of the '-w' mode and mention that passing 0 to '-q' means "no count limit". Reviewed by: glebius Fixes: 84c1edcbad7d ("Rewrite netstat/if.c to use ...") Fixes: bf10ffe1d3a9 ("Add a new option, -q howmany, ...") MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56227
Diffstat (limited to 'lib/isc/ia64/(developers-only)')
0 files changed, 0 insertions, 0 deletions