remove ReadDir.end_of_stream on targets that don't use it
This commit is contained in:
parent
c1297eca3e
commit
365e00aeee
1 changed files with 18 additions and 1 deletions
|
@ -185,6 +185,12 @@ struct InnerReadDir {
|
||||||
|
|
||||||
pub struct ReadDir {
|
pub struct ReadDir {
|
||||||
inner: Arc<InnerReadDir>,
|
inner: Arc<InnerReadDir>,
|
||||||
|
#[cfg(not(any(
|
||||||
|
target_os = "solaris",
|
||||||
|
target_os = "illumos",
|
||||||
|
target_os = "fuchsia",
|
||||||
|
target_os = "redox",
|
||||||
|
)))]
|
||||||
end_of_stream: bool,
|
end_of_stream: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -943,7 +949,18 @@ pub fn readdir(p: &Path) -> io::Result<ReadDir> {
|
||||||
Err(Error::last_os_error())
|
Err(Error::last_os_error())
|
||||||
} else {
|
} else {
|
||||||
let inner = InnerReadDir { dirp: Dir(ptr), root };
|
let inner = InnerReadDir { dirp: Dir(ptr), root };
|
||||||
Ok(ReadDir { inner: Arc::new(inner), end_of_stream: false })
|
cfg_if::cfg_if! {
|
||||||
|
if #[cfg(not(any(
|
||||||
|
target_os = "solaris",
|
||||||
|
target_os = "illumos",
|
||||||
|
target_os = "fuchsia",
|
||||||
|
target_os = "redox",
|
||||||
|
)))] {
|
||||||
|
Ok(ReadDir { inner: Arc::new(inner), end_of_stream: false })
|
||||||
|
} else {
|
||||||
|
Ok(ReadDir { inner: Arc::new(inner) })
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue