Skip to content

Commit

Permalink
remove ReadDir.end_of_stream on targets that don't use it
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Oct 9, 2020
1 parent c1297ec commit 365e00a
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion library/std/src/sys/unix/fs.rs
Expand Up @@ -185,6 +185,12 @@ struct InnerReadDir {

pub struct ReadDir {
inner: Arc<InnerReadDir>,
#[cfg(not(any(
target_os = "solaris",
target_os = "illumos",
target_os = "fuchsia",
target_os = "redox",
)))]
end_of_stream: bool,
}

Expand Down Expand Up @@ -943,7 +949,18 @@ pub fn readdir(p: &Path) -> io::Result<ReadDir> {
Err(Error::last_os_error())
} else {
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) })
}
}
}
}
}
Expand Down

0 comments on commit 365e00a

Please sign in to comment.