From 1a58c7f2115a982a9156779bb6141acd303ddef5 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Mon, 9 Dec 2013 15:49:48 -0800 Subject: client: Handle EINTR in wl_display_dispatch_queue() Restart the poll() if we take a signal. This is easily triggered in an application that ends up blocking in eglSwapBuffers(), and causes EGL to fail to allocate a back buffer. --- src/wayland-client.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wayland-client.c b/src/wayland-client.c index 7503ca0..363d5dd 100644 --- a/src/wayland-client.c +++ b/src/wayland-client.c @@ -1313,7 +1313,11 @@ wl_display_dispatch_queue(struct wl_display *display, pfd[0].fd = display->fd; pfd[0].events = POLLIN; - if (poll(pfd, 1, -1) == -1) { + do { + ret = poll(pfd, 1, -1); + } while (ret == -1 && errno == EINTR); + + if (ret == -1) { wl_display_cancel_read(display); return -1; } -- cgit v1.2.3