mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
Use CLOCK_UPTIME to get the uptime.
This commit is contained in:
parent
cfccce310a
commit
b6eec535d3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=241484
|
@ -447,7 +447,7 @@ pr_header(time_t *nowp, int nusers)
|
|||
/*
|
||||
* Print how long system has been up.
|
||||
*/
|
||||
if (clock_gettime(CLOCK_MONOTONIC, &tp) != -1) {
|
||||
if (clock_gettime(CLOCK_UPTIME, &tp) != -1) {
|
||||
uptime = tp.tv_sec;
|
||||
if (uptime > 60)
|
||||
uptime += 30;
|
||||
|
|
Loading…
Reference in a new issue