clients: Check return value of wl_display_dispatch()
The simple clients all just call wl_display_dispatch() in a while loop
without checking the return value. Now, if the server dies or other
error occurs, we get a -1 return value instead and need to break the loop.
diff --git a/clients/window.c b/clients/window.c
index 3f6a7c7..1d6600c 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -3837,8 +3837,13 @@
return;
}
- if (events & EPOLLIN)
- wl_display_dispatch(display->display);
+ if (events & EPOLLIN) {
+ ret = wl_display_dispatch(display->display);
+ if (ret == -1) {
+ display_exit(display);
+ return;
+ }
+ }
if (events & EPOLLOUT) {
ret = wl_display_flush(display->display);