summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-08-06 10:07:38 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-08-06 10:07:38 +0200
commite73e13120e2018297d7b5abb4bae552384b3e6dd (patch)
treedbd640cdeb2d92ca6fc280120c6305ff1eabfdc8 /src
parent128aa08be8d16a173e0b9187cd48c48b9f2d3ef1 (diff)
Check for error while communicating with Wayland.
Diffstat (limited to 'src')
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
index ce050dd36..44f0640ae 100644
--- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
@@ -1065,11 +1065,13 @@ static const struct wl_registry_listener registry_listener = {
static void fd_callback(int fd, struct wl_display *display) {
- struct pollfd fds;
- fds.fd = fd;
- fds.events = POLLIN;
- fds.revents = 0;
- do wl_display_dispatch(display);
+ struct pollfd fds = (struct pollfd) { fd, POLLIN, 0 };
+ do {
+ if (wl_display_dispatch(display) == -1) {
+ Fl::fatal("Fatal error while communicating with the Wayland server: errno=%d\n",
+ wl_display_get_error(display));
+ }
+ }
while (poll(&fds, 1, 0) > 0);
}