1
Fork 0

Don't use LFS64 symbols on musl

Simplify #[cfg] blocks

fmt

don't try to use the more appropriate direntry on musl
This commit is contained in:
git-bruh 2023-09-19 19:47:50 +05:30 committed by git-bruh
parent 2cad938a81
commit 7a504cc68a
3 changed files with 42 additions and 14 deletions

View file

@ -329,7 +329,14 @@ pub trait MetadataExt {
impl MetadataExt for Metadata {
#[allow(deprecated)]
fn as_raw_stat(&self) -> &raw::stat {
unsafe { &*(self.as_inner().as_inner() as *const libc::stat64 as *const raw::stat) }
#[cfg(target_env = "musl")]
unsafe {
&*(self.as_inner().as_inner() as *const libc::stat as *const raw::stat)
}
#[cfg(not(target_env = "musl"))]
unsafe {
&*(self.as_inner().as_inner() as *const libc::stat64 as *const raw::stat)
}
}
fn st_dev(&self) -> u64 {
self.as_inner().as_inner().st_dev as u64