Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions src/uucore/src/lib/features/uptime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,8 @@ fn get_macos_boot_time_sysctl() -> Option<time_t> {
/// # Returns
///
/// Returns a UResult with the uptime in seconds if successful, otherwise an UptimeError.
#[cfg(any(
target_os = "linux",
target_os = "android",
target_os = "fuchsia",
target_os = "openbsd"
))]
#[cfg(unix)]
#[cfg(not(any(target_os = "cygwin", target_os = "netbsd", target_vendor = "apple")))]
#[allow(clippy::unnecessary_wraps, reason = "needed on some platforms")]
pub fn get_uptime(_boot_time: Option<time_t>) -> UResult<i64> {
use rustix::time::{ClockId, clock_gettime};
Expand All @@ -120,13 +116,7 @@ pub fn get_uptime(_boot_time: Option<time_t>) -> UResult<i64> {
/// # Returns
///
/// Returns a UResult with the uptime in seconds if successful, otherwise an UptimeError.
#[cfg(unix)]
#[cfg(not(any(
target_os = "linux",
target_os = "android",
target_os = "fuchsia",
target_os = "openbsd"
)))]
#[cfg(any(target_os = "cygwin", target_os = "netbsd", target_vendor = "apple"))]
pub fn get_uptime(boot_time: Option<time_t>) -> UResult<i64> {
use crate::utmpx::BOOT_TIME;
use crate::utmpx::Utmpx;
Expand Down
Loading