From ee39dff1e7de4a234f2ff39c1ce2df6bc84abb04 Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Wed, 20 Dec 2017 05:51:23 -0500 Subject: rootston: handle backend creation failed --- rootston/main.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'rootston') diff --git a/rootston/main.c b/rootston/main.c index aa20dbba..2f913272 100644 --- a/rootston/main.c +++ b/rootston/main.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -32,6 +33,12 @@ int main(int argc, char **argv) { assert(server.backend = wlr_backend_autocreate(server.wl_display)); + if (wlr_multi_is_empty(server.backend)) { + wlr_log(L_ERROR, "could not start backend"); + wlr_backend_destroy(server.backend); + return 1; + } + assert(server.renderer = wlr_gles2_renderer_create(server.backend)); server.data_device_manager = wlr_data_device_manager_create(server.wl_display); -- cgit v1.2.3 From 9871cde60433699468e2bd30b60382904173ba55 Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Thu, 21 Dec 2017 18:27:38 -0500 Subject: rootston: server backend check --- rootston/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rootston') diff --git a/rootston/main.c b/rootston/main.c index 2f913272..161824d6 100644 --- a/rootston/main.c +++ b/rootston/main.c @@ -31,9 +31,9 @@ int main(int argc, char **argv) { assert(server.wl_display = wl_display_create()); assert(server.wl_event_loop = wl_display_get_event_loop(server.wl_display)); - assert(server.backend = wlr_backend_autocreate(server.wl_display)); + server.backend = wlr_backend_autocreate(server.wl_display); - if (wlr_multi_is_empty(server.backend)) { + if (server.backend == NULL) { wlr_log(L_ERROR, "could not start backend"); wlr_backend_destroy(server.backend); return 1; -- cgit v1.2.3