HomeFreeBSD

w: cosmetic fixes.

Description

w: cosmetic fixes.

Sponsored by: Klara, Inc.

(cherry picked from commit 04f6b9cb1822fdd6ab1cbeeafb38a6b354b61ca7)

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 deb2f1b616f1369d2e773096a6c0c302cb3a9060)

Details

Provenance
desAuthored on Oct 21 2022, 4:37 PM
Differential Revision
D37128: w: Fix premature rounding.
Parents
rGe3a294324944: pax: remove 4.4BSD compatibility
Branches
Unknown
Tags
Unknown