diff --git a/src/uucore/src/lib/features/buf_copy.rs b/src/uucore/src/lib/features/buf_copy.rs index 7c0b2bc5c..179ecc8d9 100644 --- a/src/uucore/src/lib/features/buf_copy.rs +++ b/src/uucore/src/lib/features/buf_copy.rs @@ -50,7 +50,7 @@ mod tests { } #[test] - #[cfg(unix)] + #[cfg(target_os = "linux")] fn test_copy_stream() { let mut dest_file = new_temp_file(); @@ -72,8 +72,8 @@ mod tests { } #[test] - #[cfg(not(unix))] - // Test for non-unix platforms. We use regular files instead. + #[cfg(not(target_os = "linux"))] + // Test for non-linux platforms. We use regular files instead. fn test_copy_stream() { let temp_dir = tempdir().unwrap(); let src_path = temp_dir.path().join("src.txt"); diff --git a/src/uucore/src/lib/features/pipes.rs b/src/uucore/src/lib/features/pipes.rs index 0a31aa95a..6a90faab8 100644 --- a/src/uucore/src/lib/features/pipes.rs +++ b/src/uucore/src/lib/features/pipes.rs @@ -7,7 +7,7 @@ #[cfg(any(target_os = "linux", target_os = "android"))] use rustix::pipe::{SpliceFlags, fcntl_setpipe_size}; -#[cfg(any(target_os = "linux", target_os = "android", test))] +#[cfg(any(target_os = "linux", target_os = "android"))] use std::fs::File; #[cfg(any(target_os = "linux", target_os = "android"))] use std::{io::Read, os::fd::AsFd, sync::OnceLock}; @@ -22,11 +22,10 @@ const KERNEL_DEFAULT_PIPE_SIZE: usize = 64 * 1024; /// from the first. /// used for resolving the limitation for splice: one of a input or output should be pipe #[inline] -#[cfg(any(target_os = "linux", target_os = "android", test))] +#[cfg(any(target_os = "linux", target_os = "android"))] pub fn pipe() -> std::io::Result<(File, File)> { let (read, write) = rustix::pipe::pipe()?; // improve performance for splice - #[cfg(any(target_os = "linux", target_os = "android"))] let _ = fcntl_setpipe_size(&read, MAX_ROOTLESS_PIPE_SIZE); Ok((File::from(read), File::from(write)))