From 021c0a9bcd7a4741b7d3c2019876248ee7483dbf Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Fri, 6 May 2022 06:56:32 -0700 Subject: [PATCH] window: ignore EINTR, which mio now propagates The upgrade to a newer mio version caused the poll method to report EINTR in some cases. We don't need to terminate for those, so suppress it. refs: https://github.com/wez/wezterm/issues/1955 --- window/src/os/wayland/connection.rs | 3 +++ window/src/os/x11/connection.rs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/window/src/os/wayland/connection.rs b/window/src/os/wayland/connection.rs index e5cf9fea9..146d0f8a0 100644 --- a/window/src/os/wayland/connection.rs +++ b/window/src/os/wayland/connection.rs @@ -317,6 +317,9 @@ impl ConnectionOps for WaylandConnection { self.flush()?; if let Err(err) = poll.poll(&mut events, timeout) { + if err.kind() == std::io::ErrorKind::Interrupted { + continue; + } bail!("polling for events: {:?}", err); } diff --git a/window/src/os/x11/connection.rs b/window/src/os/x11/connection.rs index af5daf269..d96801c49 100644 --- a/window/src/os/x11/connection.rs +++ b/window/src/os/x11/connection.rs @@ -229,6 +229,9 @@ impl ConnectionOps for XConnection { self.dispatch_pending_events()?; if let Err(err) = poll.poll(&mut events, None) { + if err.kind() == std::io::ErrorKind::Interrupted { + continue; + } bail!("polling for events: {:?}", err); } }