wl_display_flush() can fail with EAGAIN and Xwayland would make this a
fatal error.

Handle the usual EAGAIN and EINTR gracefully so that Xwayland doesn't
die for so little.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1278159
Signed-off-by: Olivier Fourdan <ofour...@redhat.com>
---
 hw/xwayland/xwayland.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 847321e..0c67cc8 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -496,7 +496,10 @@ xwl_dispatch_events (struct xwl_screen *xwl_screen)
 
     xwl_screen->prepare_read = 1;
 
-    ret = wl_display_flush(xwl_screen->display);
+    do {
+            ret = wl_display_flush(xwl_screen->display);
+    } while (ret == -1 && (errno == EINTR || errno == EAGAIN));
+
     if (ret == -1)
         FatalError("failed to write to XWayland fd: %s\n", strerror(errno));
 }
-- 
2.9.3

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to