On X11, don't panic when getting EINTR

Fixes #1972.
This commit is contained in:
mahkoh 2021-11-20 01:24:45 +01:00 committed by GitHub
parent f2de8475fc
commit e9d5b2007a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -360,7 +360,11 @@ impl<T: 'static> EventLoop<T> {
// If the XConnection already contains buffered events, we don't
// need to wait for data on the socket.
if !self.event_processor.poll() {
self.poll.poll(&mut events, timeout).unwrap();
if let Err(e) = self.poll.poll(&mut events, timeout) {
if e.raw_os_error() != Some(libc::EINTR) {
panic!("epoll returned an error: {:?}", e);
}
}
events.clear();
}