From cf9046a962f53e965a5f4b0edae5e3d95cecd4d6 Mon Sep 17 00:00:00 2001 From: pin Date: Wed, 20 Sep 2023 09:08:43 +0200 Subject: [PATCH 1/2] Add NetBSD support to uucore. Fixes https://github.com/uutils/coreutils/issues/5288 --- src/uucore/src/lib/features/fs.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/uucore/src/lib/features/fs.rs b/src/uucore/src/lib/features/fs.rs index 3def63ad6b1..8c563980a70 100644 --- a/src/uucore/src/lib/features/fs.rs +++ b/src/uucore/src/lib/features/fs.rs @@ -114,6 +114,7 @@ impl FileInformation { not(target_vendor = "apple"), not(target_os = "android"), not(target_os = "freebsd"), + not(target_os = "netbsd"), not(target_arch = "aarch64"), not(target_arch = "riscv64"), target_pointer_width = "64" @@ -125,6 +126,7 @@ impl FileInformation { target_vendor = "apple", target_os = "android", target_os = "freebsd", + target_os = "netbsd", target_arch = "aarch64", target_arch = "riscv64", not(target_pointer_width = "64") @@ -137,9 +139,9 @@ impl FileInformation { #[cfg(unix)] pub fn inode(&self) -> u64 { - #[cfg(all(not(target_os = "freebsd"), target_pointer_width = "64"))] + #[cfg(all(not(any(target_os = "freebsd", target_os = "netbsd")), target_pointer_width = "64"))] return self.0.st_ino; - #[cfg(any(target_os = "freebsd", not(target_pointer_width = "64")))] + #[cfg(any(target_os = "freebsd", target_os = "netbsd", not(target_pointer_width = "64")))] return self.0.st_ino.into(); } } From 8812889db8d219342b5f6095aa63ebdc9e7d673d Mon Sep 17 00:00:00 2001 From: pin Date: Wed, 20 Sep 2023 09:45:18 +0200 Subject: [PATCH 2/2] rustfmt --- src/uucore/src/lib/features/fs.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/uucore/src/lib/features/fs.rs b/src/uucore/src/lib/features/fs.rs index 8c563980a70..719efc7a6e7 100644 --- a/src/uucore/src/lib/features/fs.rs +++ b/src/uucore/src/lib/features/fs.rs @@ -139,9 +139,16 @@ impl FileInformation { #[cfg(unix)] pub fn inode(&self) -> u64 { - #[cfg(all(not(any(target_os = "freebsd", target_os = "netbsd")), target_pointer_width = "64"))] + #[cfg(all( + not(any(target_os = "freebsd", target_os = "netbsd")), + target_pointer_width = "64" + ))] return self.0.st_ino; - #[cfg(any(target_os = "freebsd", target_os = "netbsd", not(target_pointer_width = "64")))] + #[cfg(any( + target_os = "freebsd", + target_os = "netbsd", + not(target_pointer_width = "64") + ))] return self.0.st_ino.into(); } }