aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2025-05-02 11:46:18 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-05-02 11:46:18 +0000
commit5080e271c2fa5899ccb37384c26491e025b225ca (patch)
tree48ce46b4773bba729b4f2ded4b4d96025145d63d
parentwayland: always call wl_display_dispatch_pending() at least once, after reading (diff)
wayland: attempt to log protocol errors on failure to flush
When failing to flush, and the error is EPIPE, attempt to read and dispatch events. This ensures protocol errors are logged.
-rw-r--r--wayland.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/wayland.c b/wayland.c
index a41b5060..08994202 100644
--- a/wayland.c
+++ b/wayland.c
@@ -2247,7 +2247,14 @@ wayl_flush(struct wayland *wayl)
}
if (errno != EAGAIN) {
- LOG_ERRNO("failed to flush wayland socket");
+ const int saved_errno = errno;
+
+ if (errno == EPIPE) {
+ wl_display_read_events(wayl->display);
+ wl_display_dispatch_pending(wayl->display);
+ }
+
+ LOG_ERRNO_P(saved_errno, "failed to flush wayland socket");
return;
}