summaryrefslogtreecommitdiff
path: root/src/wayland-client.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wayland-client.c')
-rw-r--r--src/wayland-client.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/wayland-client.c b/src/wayland-client.c
index cb091ab..45aa372 100644
--- a/src/wayland-client.c
+++ b/src/wayland-client.c
@@ -876,7 +876,15 @@ read_events(struct wl_display *display)
if (errno != EAGAIN)
display_fatal_error(display, errno);
return -1;
+ } else if (total == 0) {
+ /* The compositor has closed the socket. This
+ * should be considered an error so we'll fake
+ * an errno */
+ errno = EPIPE;
+ display_fatal_error(display, errno);
+ return -1;
}
+
for (rem = total; rem >= 8; rem -= size) {
size = queue_event(display, rem);
if (size == -1) {