Skip to content

Commit 62025d8

Browse files
authored
Merge pull request #7469 from Ecordonnier/eco/fsid_t-fix
fsext.rs: use type inference fsid_t / __fsid_t
2 parents e646126 + 8f17113 commit 62025d8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/uucore/src/lib/features/fsext.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -812,8 +812,9 @@ impl FsMeta for StatFs {
812812
target_os = "openbsd"
813813
))]
814814
fn fsid(&self) -> u64 {
815-
let f_fsid: &[u32; 2] =
816-
unsafe { &*(&self.f_fsid as *const nix::sys::statfs::fsid_t as *const [u32; 2]) };
815+
// Use type inference to determine the type of f_fsid
816+
// (libc::__fsid_t on Android, libc::fsid_t on other platforms)
817+
let f_fsid: &[u32; 2] = unsafe { &*(&self.f_fsid as *const _ as *const [u32; 2]) };
817818
((u64::from(f_fsid[0])) << 32) | u64::from(f_fsid[1])
818819
}
819820
#[cfg(not(any(

0 commit comments

Comments
 (0)