Fix Windows

This commit is contained in:
sxyazi 2026-06-19 09:27:05 +08:00
parent 73a0d7fc13
commit 42ea744901
No known key found for this signature in database
3 changed files with 3 additions and 2 deletions

View file

@ -28,7 +28,7 @@ impl<'a> EventSource<'a> {
// More input is ready. // More input is ready.
WAIT_OBJECT_0 => Ok(()), WAIT_OBJECT_0 => Ok(()),
// Stop waiting for events. // Stop waiting for events.
r if r == WAIT_OBJECT_0 + 1 => Err(io::Error::from(io::ErrorKind::UnexpectedEof)), r if r == WAIT_OBJECT_0 + 1 => Err(io::Error::from(io::ErrorKind::ConnectionAborted)),
// Timeout expired. // Timeout expired.
WAIT_TIMEOUT => Err(io::Error::from(io::ErrorKind::TimedOut)), WAIT_TIMEOUT => Err(io::Error::from(io::ErrorKind::TimedOut)),
// An error occurred. // An error occurred.

View file

@ -33,6 +33,7 @@ impl EventStream {
} }
// try_poll() already handles Interrupted, this is defensive. // try_poll() already handles Interrupted, this is defensive.
Err(e) if e.kind() == io::ErrorKind::Interrupted => continue, Err(e) if e.kind() == io::ErrorKind::Interrupted => continue,
// event source was gracefully stopped, stop the stream as well.
Err(e) if e.kind() == io::ErrorKind::ConnectionAborted => break, Err(e) if e.kind() == io::ErrorKind::ConnectionAborted => break,
Err(e) => { Err(e) => {
tx.send(Err(e)).ok(); tx.send(Err(e)).ok();

View file

@ -109,7 +109,7 @@ impl Raterm {
Some(Err(_)) => { Some(Err(_)) => {
AppProxy::quit(Default::default()); AppProxy::quit(Default::default());
break; break;
}, }
None => break, None => break,
} }
} }