window: check the initial wl_display_dispatch()
Check for errors in the first wl_display_dispatch() call. Otherwise doing something silly like $ WAYLAND_SOCKET=999 ./clickdot will segfault. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
This commit is contained in:
committed by
Kristian Høgsberg
parent
4e1065491b
commit
33a68eaaf4
+6
-1
@@ -4287,7 +4287,12 @@ display_create(int argc, char *argv[])
|
||||
|
||||
d->registry = wl_display_get_registry(d->display);
|
||||
wl_registry_add_listener(d->registry, ®istry_listener, d);
|
||||
wl_display_dispatch(d->display);
|
||||
|
||||
if (wl_display_dispatch(d->display) < 0) {
|
||||
fprintf(stderr, "Failed to process Wayland connection: %m\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef HAVE_CAIRO_EGL
|
||||
if (init_egl(d) < 0)
|
||||
fprintf(stderr, "EGL does not seem to work, "
|
||||
|
||||
Reference in New Issue
Block a user