mirror of
https://github.com/uutils/coreutils
synced 2024-07-21 09:54:42 +00:00
Merge pull request #4440 from zanbaldwin/z/uptime-boot-time-calc
uptime: correctly calculate boot-time
This commit is contained in:
commit
c1d85adcc9
|
@ -115,8 +115,8 @@ fn process_utmpx() -> (Option<time_t>, usize) {
|
|||
USER_PROCESS => nusers += 1,
|
||||
BOOT_TIME => {
|
||||
let dt = line.login_time();
|
||||
if dt.second() > 0 {
|
||||
boot_time = Some(dt.second() as time_t);
|
||||
if dt.unix_timestamp() > 0 {
|
||||
boot_time = Some(dt.unix_timestamp() as time_t);
|
||||
}
|
||||
}
|
||||
_ => continue,
|
||||
|
|
Loading…
Reference in a new issue