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.
WAIT_OBJECT_0 => Ok(()),
// 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.
WAIT_TIMEOUT => Err(io::Error::from(io::ErrorKind::TimedOut)),
// An error occurred.

View file

@ -33,6 +33,7 @@ impl EventStream {
}
// try_poll() already handles Interrupted, this is defensive.
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) => {
tx.send(Err(e)).ok();

View file

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