mirror of
https://github.com/opnsense/src.git
synced 2026-07-16 04:22:59 -04:00
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: |
||
|---|---|---|
| .. | ||
| bpf.c | ||
| common.c | ||
| common.h | ||
| if.c | ||
| inet.c | ||
| inet6.c | ||
| ipsec.c | ||
| main.c | ||
| Makefile | ||
| Makefile.depend | ||
| Makefile.depend.options | ||
| mbuf.c | ||
| mroute.c | ||
| mroute6.c | ||
| netgraph.c | ||
| netisr.c | ||
| netstat.1 | ||
| netstat.h | ||
| nhgrp.c | ||
| nhops.c | ||
| nlist_symbols | ||
| pfkey.c | ||
| route.c | ||
| route_netlink.c | ||
| sctp.c | ||
| unix.c | ||