alnyan/yggdrasil: PollWait now returns errors

This commit is contained in:
2023-12-22 13:10:55 +02:00
parent e7746a8445
commit 85449aa8c3
+5 -2
View File
@@ -24,11 +24,14 @@ impl PollChannel {
}
#[unstable(feature = "yggdrasil_os", issue = "none")]
pub fn wait(&mut self, timeout: Option<Duration>) -> io::Result<Option<RawFd>> {
pub fn wait(
&mut self,
timeout: Option<Duration>,
) -> io::Result<Option<(RawFd, io::Result<()>)>> {
let mut output = None;
cvt_io(unsafe {
yggdrasil_rt::sys::poll_channel_wait(self.0.as_raw_fd(), &timeout, &mut output)
})?;
Ok(output)
Ok(output.map(|(l, r)| (l, cvt_io(r))))
}
}