opnsense-src/usr.bin/w
Dag-Erling Smørgrav deb2f1b616 w: Fix premature rounding.
If the system has been up more longer than a minute, we add 30 seconds to
the uptime so that subsequent calculations will round to the nearest minute
rather than truncate.  However, since the introduction of libxo, we output
the raw value after performing the adjustment.  Rewrite so that we output
the raw value first, then perform the adjustment and recalculate before
outputting the humanized value.

While there, reduce stack usage and avoid needless allocations.

Sponsored by:	Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37128
2022-10-26 15:56:40 +00:00
..
extern.h General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
Makefile Adopt SRCTOP in usr.bin 2017-03-12 18:58:44 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
pr_time.c w: cosmetic fixes. 2022-10-21 16:37:44 +00:00
proc_compare.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
uptime.1 uptime(1): Add EXAMPLES section 2020-08-18 16:58:37 +00:00
w.1 w(1): Add EXAMPLES to man page 2020-08-24 17:57:08 +00:00
w.c w: Fix premature rounding. 2022-10-26 15:56:40 +00:00