aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2019-08-15 20:00:24 +0100
committerHarry Jeffery <harry@exec64.co.uk>2019-08-15 20:23:16 +0100
commitecf7fcd27192f074c109ca75c0c03866d2b50540 (patch)
tree8bfdd3c48647036b71e8e44cd8bd27918bf341c2
parent5425a392951bca24bd32ea68f2abe6782af437f5 (diff)
downloadimv-ecf7fcd27192f074c109ca75c0c03866d2b50540.tar.gz
wl_window: Check poll() return code
-rw-r--r--src/wl_window.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wl_window.c b/src/wl_window.c
index 021d9aa..e0fa251 100644
--- a/src/wl_window.c
+++ b/src/wl_window.c
@@ -792,7 +792,10 @@ void imv_window_wait_for_event(struct imv_window *window, double timeout)
wl_display_flush(window->wl_display);
- poll(fds, nfds, timeout * 1000);
+ if (poll(fds, nfds, timeout * 1000) <= 0) {
+ wl_display_cancel_read(window->wl_display);
+ return;
+ }
if (fds[0].revents & POLLIN) {
wl_display_read_events(window->wl_display);