mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07: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:
@@ -812,8 +812,9 @@ impl FsMeta for StatFs {
|
||||
target_os = "openbsd"
|
||||
))]
|
||||
fn fsid(&self) -> u64 {
|
||||
let f_fsid: &[u32; 2] =
|
||||
unsafe { &*(&self.f_fsid as *const nix::sys::statfs::fsid_t as *const [u32; 2]) };
|
||||
// Use type inference to determine the type of f_fsid
|
||||
// (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])
|
||||
}
|
||||
#[cfg(not(any(
|
||||
|
||||
Reference in New Issue
Block a user