mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 12:37:49 +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:
commit
62025d862f
1 changed files with 3 additions and 2 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue