Cleanup empty event behavior
This commit is contained in:
@@ -263,18 +263,9 @@ pub(crate) fn poll_oneoff(
|
|||||||
if fd_events.is_empty() {
|
if fd_events.is_empty() {
|
||||||
match timeout {
|
match timeout {
|
||||||
Some((event, dur)) => return Ok(handle_timeout(event, dur, events)),
|
Some((event, dur)) => return Ok(handle_timeout(event, dur, events)),
|
||||||
// `poll` invoked with nfds = 0, timeout = -1 appears to be an infinite sleep on Unix
|
// The implementation has to return Ok(()) in this case,
|
||||||
// usually meant to be interrupted by a signal. Unfortunately, WASI doesn't currently
|
// cf. the comment in src/hostcalls_impl/misc.rs
|
||||||
// support signals and there is no way to interrupt this infinite sleep, so we
|
None => return Ok(()),
|
||||||
// intend to return `ENOTSUP`.
|
|
||||||
//
|
|
||||||
// Unfortunately, current implementation of poll_oneoff on Unix relies on
|
|
||||||
// `poll_oneoff` returning `Ok(())` in such case, so we emulate this behavior for now
|
|
||||||
// and will address it in a subsequent PR.
|
|
||||||
None => {
|
|
||||||
// error!("poll_oneoff: invoking with neither timeout nor fds not supported");
|
|
||||||
return Ok(()); // Err(Error::ENOTSUP);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user