HomeFreeBSD

w: Fix premature rounding.

Description

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

Details

Provenance
desAuthored on Oct 24 2022, 2:02 PM
Differential Revision
D37128: w: Fix premature rounding.
Parents
rGd346e3ac3310: vfs: use cache_assert_no_entries instead of open-coding it
Branches
Unknown
Tags
Unknown