diff --git a/Cargo.lock b/Cargo.lock index 47ecd75af57..bbc4e73f0c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1651,9 +1651,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.175" +version = "0.2.178" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" +checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" [[package]] name = "libloading" diff --git a/src/uucore/src/lib/features/fs.rs b/src/uucore/src/lib/features/fs.rs index 9c710858082..bebfd1821cf 100644 --- a/src/uucore/src/lib/features/fs.rs +++ b/src/uucore/src/lib/features/fs.rs @@ -138,7 +138,6 @@ impl FileInformation { any( target_vendor = "apple", target_os = "android", - target_os = "freebsd", target_os = "netbsd", target_os = "openbsd", target_os = "illumos", @@ -152,6 +151,8 @@ impl FileInformation { ) ))] return self.0.st_nlink.into(); + #[cfg(target_os = "freebsd")] + return self.0.st_nlink; #[cfg(target_os = "aix")] return self.0.st_nlink.try_into().unwrap(); #[cfg(windows)] @@ -160,16 +161,9 @@ 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 = "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 = "netbsd", not(target_pointer_width = "64")))] return self.0.st_ino.into(); } } diff --git a/src/uucore/src/lib/features/fsext.rs b/src/uucore/src/lib/features/fsext.rs index f2ae59a76f3..ec88a5e614e 100644 --- a/src/uucore/src/lib/features/fsext.rs +++ b/src/uucore/src/lib/features/fsext.rs @@ -446,11 +446,8 @@ unsafe extern "C" { #[link_name = "getmntinfo"] fn get_mount_info(mount_buffer_p: *mut *mut StatFs, flags: c_int) -> c_int; - // Rust on FreeBSD uses 11.x ABI for filesystem metadata syscalls. - // Call the right version of the symbol for getmntinfo() result to - // match libc StatFS layout. #[cfg(target_os = "freebsd")] - #[link_name = "getmntinfo@FBSD_1.0"] + #[link_name = "getmntinfo"] fn get_mount_info(mount_buffer_p: *mut *mut StatFs, flags: c_int) -> c_int; }