diff --git a/Cargo.lock b/Cargo.lock index 076275bec..c6a7be71b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3439,7 +3439,6 @@ dependencies = [ "thiserror 2.0.12", "utmp-classic", "uucore", - "windows-sys 0.59.0", ] [[package]] diff --git a/src/uu/uptime/Cargo.toml b/src/uu/uptime/Cargo.toml index 2134a8003..588b9e8a0 100644 --- a/src/uu/uptime/Cargo.toml +++ b/src/uu/uptime/Cargo.toml @@ -25,12 +25,6 @@ uucore = { workspace = true, features = ["libc", "utmpx", "uptime"] } [target.'cfg(target_os = "openbsd")'.dependencies] utmp-classic = { workspace = true } -[target.'cfg(target_os="windows")'.dependencies] -windows-sys = { workspace = true, features = [ - "Win32_System_RemoteDesktop", - "Wdk_System_SystemInformation", -] } - [[bin]] name = "uptime" path = "src/main.rs" diff --git a/src/uucore/Cargo.toml b/src/uucore/Cargo.toml index 97a684cb5..522e9249f 100644 --- a/src/uucore/Cargo.toml +++ b/src/uucore/Cargo.toml @@ -75,6 +75,7 @@ windows-sys = { workspace = true, optional = true, default-features = false, fea "Win32_Storage_FileSystem", "Win32_Foundation", "Win32_System_RemoteDesktop", + "Win32_System_SystemInformation", "Win32_System_WindowsProgramming", ] } diff --git a/src/uucore/src/lib/features/uptime.rs b/src/uucore/src/lib/features/uptime.rs index e82a767d8..379850df9 100644 --- a/src/uucore/src/lib/features/uptime.rs +++ b/src/uucore/src/lib/features/uptime.rs @@ -150,7 +150,7 @@ pub fn get_uptime(_boot_time: Option) -> UResult { if uptime < 0 { Err(UptimeError::SystemUptime)?; } - Ok(uptime as i64) + Ok(uptime as i64 / 1000) } /// Get the system uptime in a human-readable format