alnyan/yggdrasil: PollWait now returns errors
This commit is contained in:
@@ -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))))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user