From f74d4d97baefd7792e02424cb6f6e8d10a40ba57 Mon Sep 17 00:00:00 2001 From: Muhamed Hobi Date: Tue, 18 Jan 2022 23:31:37 -0500 Subject: [PATCH] Add error when wayland connection fails https://github.com/vilhalmer/oguri/issues/46 --- oguri.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/oguri.c b/oguri.c index bcf7697..58fe6fd 100644 --- a/oguri.c +++ b/oguri.c @@ -305,7 +305,10 @@ int main(int argc, char * argv[]) { signal(SIGPIPE, SIG_IGN); oguri.display = wl_display_connect(NULL); - assert(oguri.display); + if (!oguri.display) { + fprintf(stderr, "Unable to create wayland display connection. Is wayland running?\n"); + return 1; + } oguri.events[OGURI_SIGNAL_EVENT] = (struct pollfd) { .fd = signal_pipe[0],