mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
uptime: correctly calculate boot-time
This commit is contained in:
parent
c148215e7d
commit
351be7f478
1 changed files with 2 additions and 2 deletions
|
@ -115,8 +115,8 @@ fn process_utmpx() -> (Option<time_t>, usize) {
|
||||||
USER_PROCESS => nusers += 1,
|
USER_PROCESS => nusers += 1,
|
||||||
BOOT_TIME => {
|
BOOT_TIME => {
|
||||||
let dt = line.login_time();
|
let dt = line.login_time();
|
||||||
if dt.second() > 0 {
|
if dt.unix_timestamp() > 0 {
|
||||||
boot_time = Some(dt.second() as time_t);
|
boot_time = Some(dt.unix_timestamp() as time_t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => continue,
|
_ => continue,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue