mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-03 07:15:29 -04:00
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.
This commit is contained in:
parent
7bdecaae3b
commit
c3c2ff7398
1 changed files with 6 additions and 2 deletions
|
|
@ -1126,8 +1126,12 @@ fdm_wayl(struct fdm *fdm, int fd, int events, void *data)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (wl_display_prepare_read(wayl->display) != 0)
|
while (wl_display_prepare_read(wayl->display) != 0) {
|
||||||
wl_display_dispatch_pending(wayl->display);
|
if (wl_display_dispatch_pending(wayl->display) < 0) {
|
||||||
|
LOG_ERRNO("failed to dispatch pending Wayland events");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (events & EPOLLHUP) {
|
if (events & EPOLLHUP) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue