diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-05-24 18:51:30 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-05-25 15:50:17 +0000 |
| commit | c3c2ff739853432a15f75f53744c4998a0c27455 (patch) | |
| tree | b44bba20e807c5a9da7c2dda87c521387fc435ef | |
| parent | wayland: roundtrip: log error and abort when wl_display_roundtrip() fails (diff) | |
wayland: fdm callback: check return value of wl_display_dispatch_pending()
Since it’s inside a while-loop, we’d better handle failures, or we
risk getting stuck.
| -rw-r--r-- | wayland.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1126,8 +1126,12 @@ fdm_wayl(struct fdm *fdm, int fd, int events, void *data) return false; } - while (wl_display_prepare_read(wayl->display) != 0) - wl_display_dispatch_pending(wayl->display); + while (wl_display_prepare_read(wayl->display) != 0) { + if (wl_display_dispatch_pending(wayl->display) < 0) { + LOG_ERRNO("failed to dispatch pending Wayland events"); + return false; + } + } } if (events & EPOLLHUP) { |
