This commit is contained in:
Marcin Mielniczuk
2020-01-16 13:20:24 +01:00
parent cea6542fd8
commit 748894a121

View File

@@ -9,7 +9,7 @@ use crate::{wasi, wasi32, Error, Result};
use cpu_time::{ProcessTime, ThreadTime}; use cpu_time::{ProcessTime, ThreadTime};
use crossbeam::channel::{self, Receiver, Sender}; use crossbeam::channel::{self, Receiver, Sender};
use lazy_static::lazy_static; use lazy_static::lazy_static;
use log::{error, trace}; use log::{error, trace, warning};
use std::convert::TryInto; use std::convert::TryInto;
use std::io; use std::io;
use std::os::windows::io::AsRawHandle; use std::os::windows::io::AsRawHandle;
@@ -242,7 +242,10 @@ pub(crate) fn poll_oneoff(
// usually meant to be interrupted by a signal. Unfortunately, WASI doesn't currently // usually meant to be interrupted by a signal. Unfortunately, WASI doesn't currently
// support signals and there is no way to interrupt this infinite sleep, so we // support signals and there is no way to interrupt this infinite sleep, so we
// return `ENOTSUP` // return `ENOTSUP`
None => return Err(Error::ENOTSUP), None => {
error!("poll_oneoff: invoking with neither timeout nor fds not supported");
return Err(Error::ENOTSUP);
}
} }
} }
@@ -311,6 +314,7 @@ pub(crate) fn poll_oneoff(
PollState::Closed => { /* error? FIXME */ } PollState::Closed => { /* error? FIXME */ }
PollState::TimedOut => { /* FIXME */ } PollState::TimedOut => { /* FIXME */ }
PollState::Error(ref e) => { PollState::Error(ref e) => {
error!("PollState error");
handle_error_event(event, Error::ENOTSUP /*FIXME*/, events); handle_error_event(event, Error::ENOTSUP /*FIXME*/, events);
} }
} }
@@ -319,7 +323,7 @@ pub(crate) fn poll_oneoff(
trace!(" | actively polling stdin or pipes"); trace!(" | actively polling stdin or pipes");
match timeout { match timeout {
Some((event, dur)) => { Some((event, dur)) => {
error!("Polling pipes not supported on Windows, will just time out."); warning!("Polling pipes not supported on Windows, will just time out.");
return Ok(handle_timeout(event, dur, events)); return Ok(handle_timeout(event, dur, events));
} }
None => { None => {