aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2022-01-09 23:19:47 +0100
committerDaniel Eklöf <daniel@ekloef.se>2022-01-09 23:19:47 +0100
commit643ec33809fccd0a378190799cafcdf8521e3864 (patch)
treea6af9645c5cd67db446de7f8bbea9ea7c12c84b8 /main.c
parent530c14aa235c205ddecfc522cd836cc12d2dd10d (diff)
downloadwbg-643ec33809fccd0a378190799cafcdf8521e3864.tar.gz
main: check for errors in wl_display_dispatch()
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/main.c b/main.c
index f133d2e..5c6eed3 100644
--- a/main.c
+++ b/main.c
@@ -435,8 +435,12 @@ main(int argc, const char *const *argv)
break;
}
- if (fds[0].revents & POLLIN)
- wl_display_dispatch(display);
+ if (fds[0].revents & POLLIN) {
+ if (wl_display_dispatch(display) < 0) {
+ LOG_ERRNO("failed to dispatch Wayland events");
+ break;
+ }
+ }
if (fds[1].revents & POLLHUP)
abort();