From 5fd68db0781ba1edc000c446eb15b57ff2b1f34c Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Sun, 7 Jun 2026 21:52:57 +0200 Subject: [PATCH] cp: remove unnecessary cfgs in Linux module (#12692) --- src/uu/cp/src/platform/linux.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/uu/cp/src/platform/linux.rs b/src/uu/cp/src/platform/linux.rs index d4450114e..52574d36c 100644 --- a/src/uu/cp/src/platform/linux.rs +++ b/src/uu/cp/src/platform/linux.rs @@ -66,7 +66,6 @@ enum CopyMethod { /// Use the Linux `ioctl_ficlone` API to do a copy-on-write clone. /// /// `fallback` controls what to do if the system call fails. -#[cfg(any(target_os = "linux", target_os = "android"))] fn clone

(source: P, dest: P, fallback: CloneFallback, nofollow: bool) -> std::io::Result<()> where P: AsRef, @@ -89,7 +88,6 @@ where /// Checks whether a file contains any non null bytes i.e. any byte != 0x0 /// This function returns a tuple of (bool, u64, u64) signifying a tuple of (whether a file has /// data, its size, no of blocks it has allocated in disk) -#[cfg(any(target_os = "linux", target_os = "android"))] fn check_for_data(source: &Path, nofollow: bool) -> Result<(bool, u64, u64), std::io::Error> { let mut src_file = open_source(source, nofollow)?; let metadata = src_file.metadata()?; @@ -107,7 +105,6 @@ fn check_for_data(source: &Path, nofollow: bool) -> Result<(bool, u64, u64), std Ok((has_data, size, blocks)) } -#[cfg(any(target_os = "linux", target_os = "android"))] /// Checks whether a file is sparse i.e. it contains holes, uses the crude heuristic blocks < size / 512 /// Reference:`` fn check_sparse_detection(source: &Path, nofollow: bool) -> Result { @@ -121,7 +118,6 @@ fn check_sparse_detection(source: &Path, nofollow: bool) -> Result(source: P, dest: P, nofollow: bool) -> std::io::Result<()> where P: AsRef, @@ -156,7 +152,6 @@ where } /// Perform a sparse copy from one file to another. /// Creates a holes for large sequences of zeros in `non_sparse_files`, used for `--sparse=always` -#[cfg(any(target_os = "linux", target_os = "android"))] fn sparse_copy

(source: P, dest: P, nofollow: bool) -> std::io::Result<()> where P: AsRef, @@ -185,7 +180,6 @@ where Ok(()) } -#[cfg(any(target_os = "linux", target_os = "android"))] /// Checks whether an existing destination is a fifo fn check_dest_is_fifo(dest: &Path) -> bool { // If our destination file exists and its a fifo , we do a standard copy .