1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-31 04:57:45 +00:00

Merge pull request #7469 from Ecordonnier/eco/fsid_t-fix

fsext.rs: use type inference fsid_t / __fsid_t
This commit is contained in:
Daniel Hofstetter 2025-03-17 15:17:27 +01:00 committed by GitHub
commit 62025d862f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -812,8 +812,9 @@ impl FsMeta for StatFs {
target_os = "openbsd" target_os = "openbsd"
))] ))]
fn fsid(&self) -> u64 { fn fsid(&self) -> u64 {
let f_fsid: &[u32; 2] = // Use type inference to determine the type of f_fsid
unsafe { &*(&self.f_fsid as *const nix::sys::statfs::fsid_t as *const [u32; 2]) }; // (libc::__fsid_t on Android, libc::fsid_t on other platforms)
let f_fsid: &[u32; 2] = unsafe { &*(&self.f_fsid as *const _ as *const [u32; 2]) };
((u64::from(f_fsid[0])) << 32) | u64::from(f_fsid[1]) ((u64::from(f_fsid[0])) << 32) | u64::from(f_fsid[1])
} }
#[cfg(not(any( #[cfg(not(any(