From b378240a388d70eb8a1642581fa05d2e05eb05b5 Mon Sep 17 00:00:00 2001 From: Richard Acayan Date: Tue, 30 Jul 2024 17:27:44 -0400 Subject: [PATCH] wayland: ignore errors when reading socket On Phosh, the EWOULDBLOCK error may be emitted when reading from the Wayland socket, which is not fatal. Ignore errors encountered while reading, as fatal errors would be emitted by other operations in the main loop. --- src/ufkbd_gnome.rs | 3 ++- src/ufkbd_wl.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ufkbd_gnome.rs b/src/ufkbd_gnome.rs index d5c5746..6e94c01 100644 --- a/src/ufkbd_gnome.rs +++ b/src/ufkbd_gnome.rs @@ -87,7 +87,8 @@ async fn main() poller.delete(fd).unwrap(); if !events.is_empty() { - guard.read().unwrap(); + // This may still emit EWOULDBLOCK errors. + let _ = guard.read(); queue.dispatch_pending(&mut dispatcher).unwrap(); } diff --git a/src/ufkbd_wl.rs b/src/ufkbd_wl.rs index a053a80..426155b 100644 --- a/src/ufkbd_wl.rs +++ b/src/ufkbd_wl.rs @@ -57,7 +57,8 @@ fn main() poller.delete(fd).unwrap(); if !events.is_empty() { - guard.read().unwrap(); + // This may still emit EWOULDBLOCK errors. + let _ = guard.read(); queue.dispatch_pending(&mut dispatcher).unwrap(); }