From 324d846567abcdf79f94e8964161c4fda2498567 Mon Sep 17 00:00:00 2001 From: Manuel Stoeckl Date: Wed, 7 Aug 2019 23:21:16 -0400 Subject: [PATCH] clients/simple-egl: Exit when display has an error Check return values for wl_display_dispatch_* functions, so that the program stops running when the compositor that it is connected to crashes. Signed-off-by: Manuel Stoeckl --- clients/simple-egl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clients/simple-egl.c b/clients/simple-egl.c index 1afde36a..2a23166e 100644 --- a/clients/simple-egl.c +++ b/clients/simple-egl.c @@ -866,9 +866,9 @@ main(int argc, char **argv) * queued up as a side effect. */ while (running && ret != -1) { if (window.wait_for_configure) { - wl_display_dispatch(display.display); + ret = wl_display_dispatch(display.display); } else { - wl_display_dispatch_pending(display.display); + ret = wl_display_dispatch_pending(display.display); redraw(&window, NULL, 0); } }