diff --git a/src/cp/cp.rs b/src/cp/cp.rs index 2014388a0..bab66bd77 100644 --- a/src/cp/cp.rs +++ b/src/cp/cp.rs @@ -674,6 +674,9 @@ fn parse_path_args(path_args: &[String], options: &Options) -> CopyResult<(Vec, source: &std::path::PathBuf, dest: std::path::PathBuf, found_hard_link: &mut bool) -> CopyResult<()> { + // Redox does not currently support hard links + #[cfg(not(target_os = "redox"))] + { if !source.is_dir() { unsafe { let src_path = CString::new(source.as_os_str().to_str().unwrap()).unwrap(); @@ -714,6 +717,7 @@ fn preserve_hardlinks(hard_links: &mut Vec<(String, u64)>, source: &std::path::P } } } + } Ok(()) } @@ -826,7 +830,8 @@ fn copy_directory(root: &Path, target: &Target, options: &Options) -> CopyResult } } - #[cfg(windows)] + // This should be changed once Redox supports hardlinks + #[cfg(any(windows, target_os = "redox"))] let mut hard_links: Vec<(String, u64)> = vec![]; for path in WalkDir::new(root) {