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:
parent
2cad938a81
commit
7a504cc68a
3 changed files with 42 additions and 14 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue