From 75141f03823c46ca1fc6880d66458081c8cc7f9e Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Mon, 13 Nov 2017 22:51:55 -0800 Subject: [PATCH] Fix cp build on Redox --- src/cp/cp.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) {