opnsense-src/usr.bin/w
Dag-Erling Smørgrav 7302f86971 w: cosmetic fixes.
Sponsored by:	Klara, Inc.

(cherry picked from commit 04f6b9cb18)

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

(cherry picked from commit deb2f1b616)
2022-11-02 10:41:07 +01:00
..
extern.h General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
Makefile
Makefile.depend
pr_time.c w: cosmetic fixes. 2022-11-02 10:41:07 +01: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: cosmetic fixes. 2022-11-02 10:41:07 +01:00