From 9d82fa3b9abd3d359afae0b6b9eb2a22b93b9a1c Mon Sep 17 00:00:00 2001 From: Chad Williamson Date: Thu, 11 Apr 2024 12:54:58 -0500 Subject: [PATCH] mv: avoid attempting to set xattr on redox --- src/uu/mv/src/mv.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/uu/mv/src/mv.rs b/src/uu/mv/src/mv.rs index 9f24cf77092..3722f134f27 100644 --- a/src/uu/mv/src/mv.rs +++ b/src/uu/mv/src/mv.rs @@ -27,7 +27,7 @@ use uucore::fs::{ are_hardlinks_or_one_way_symlink_to_same_file, are_hardlinks_to_same_file, path_ends_with_terminator, }; -#[cfg(all(unix, not(target_os = "macos")))] +#[cfg(all(unix, not(any(target_os = "macos", target_os = "redox"))))] use uucore::fsxattr; use uucore::update_control; @@ -634,7 +634,7 @@ fn rename_with_fallback( None }; - #[cfg(all(unix, not(target_os = "macos")))] + #[cfg(all(unix, not(any(target_os = "macos", target_os = "redox"))))] let xattrs = fsxattr::retrieve_xattrs(from).unwrap_or_else(|_| std::collections::HashMap::new()); @@ -648,7 +648,7 @@ fn rename_with_fallback( move_dir(from, to, &options) }; - #[cfg(all(unix, not(target_os = "macos")))] + #[cfg(all(unix, not(any(target_os = "macos", target_os = "redox"))))] fsxattr::apply_xattrs(to, xattrs).unwrap(); if let Err(err) = result { @@ -661,11 +661,11 @@ fn rename_with_fallback( }; } } else { - #[cfg(all(unix, not(target_os = "macos")))] + #[cfg(all(unix, not(any(target_os = "macos", target_os = "redox"))))] fs::copy(from, to) .and_then(|_| fsxattr::copy_xattrs(&from, &to)) .and_then(|_| fs::remove_file(from))?; - #[cfg(any(target_os = "macos", not(unix)))] + #[cfg(any(target_os = "macos", target_os = "redox", not(unix)))] fs::copy(from, to).and_then(|_| fs::remove_file(from))?; } }