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.
This commit is contained in:
Richard Acayan 2024-07-30 17:27:44 -04:00
parent bc9056aa8d
commit b378240a38
2 changed files with 4 additions and 2 deletions

View file

@ -87,7 +87,8 @@ async fn main()
poller.delete(fd).unwrap(); poller.delete(fd).unwrap();
if !events.is_empty() { if !events.is_empty() {
guard.read().unwrap(); // This may still emit EWOULDBLOCK errors.
let _ = guard.read();
queue.dispatch_pending(&mut dispatcher).unwrap(); queue.dispatch_pending(&mut dispatcher).unwrap();
} }

View file

@ -57,7 +57,8 @@ fn main()
poller.delete(fd).unwrap(); poller.delete(fd).unwrap();
if !events.is_empty() { if !events.is_empty() {
guard.read().unwrap(); // This may still emit EWOULDBLOCK errors.
let _ = guard.read();
queue.dispatch_pending(&mut dispatcher).unwrap(); queue.dispatch_pending(&mut dispatcher).unwrap();
} }