diff --git a/Cargo.lock b/Cargo.lock index de54b50704f..012d25256e0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4222,7 +4222,6 @@ version = "0.8.0" dependencies = [ "clap", "fluent", - "libc", "tempfile", "thiserror 2.0.18", "uucore", diff --git a/fuzz/Cargo.lock b/fuzz/Cargo.lock index 9363e1f46ce..a0ca75cc662 100644 --- a/fuzz/Cargo.lock +++ b/fuzz/Cargo.lock @@ -2034,7 +2034,6 @@ version = "0.8.0" dependencies = [ "clap", "fluent", - "libc", "thiserror", "uucore", ] diff --git a/src/uu/test/Cargo.toml b/src/uu/test/Cargo.toml index 002e42fd098..db11fc5c0b2 100644 --- a/src/uu/test/Cargo.toml +++ b/src/uu/test/Cargo.toml @@ -21,7 +21,6 @@ path = "src/test.rs" [dependencies] clap = { workspace = true } fluent = { workspace = true } -libc = { workspace = true } thiserror = { workspace = true } uucore = { workspace = true, features = ["process"] } diff --git a/src/uu/test/src/test.rs b/src/uu/test/src/test.rs index 92b1dcdde02..ae0fd5e0013 100644 --- a/src/uu/test/src/test.rs +++ b/src/uu/test/src/test.rs @@ -230,11 +230,12 @@ fn files(a: &OsStr, b: &OsStr, op: &OsStr) -> ParseResult { } fn isatty(fd: &OsStr) -> ParseResult { + use std::io::IsTerminal; fd.to_str() .map(str::trim) .and_then(|s| s.parse().ok()) .ok_or_else(|| ParseError::InvalidInteger(fd.quote().to_string())) - .map(|i| unsafe { libc::isatty(i) == 1 }) + .map(|i| unsafe { std::os::fd::BorrowedFd::borrow_raw(i) }.is_terminal()) } #[derive(Eq, PartialEq)]