From 841883b43c88538401295da776344c9d0e6e766b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Fri, 5 Dec 2008 11:19:56 -0500 Subject: [PATCH] Fail if we can't create the compositor. --- egl-compositor.c | 6 +++++- glx-compositor.c | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/egl-compositor.c b/egl-compositor.c index dddd98ac..b52166ff 100644 --- a/egl-compositor.c +++ b/egl-compositor.c @@ -1035,7 +1035,11 @@ int main(int argc, char *argv[]) display = wl_display_create(); ec = egl_compositor_create(display); - + if (ec == NULL) { + fprintf(stderr, "failed to create compositor\n"); + exit(EXIT_FAILURE); + } + wl_display_set_compositor(display, &ec->base); if (wl_display_add_socket(display, socket_name)) { diff --git a/glx-compositor.c b/glx-compositor.c index 0872f83e..a9a07576 100644 --- a/glx-compositor.c +++ b/glx-compositor.c @@ -362,6 +362,10 @@ int main(int argc, char *argv[]) display = wl_display_create(); gc = glx_compositor_create(display); + if (gc == NULL) { + fprintf(stderr, "failed to create compositor\n"); + exit(EXIT_FAILURE); + } wl_display_set_compositor(display, &gc->base);