mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2025-12-20 12:50:11 +01:00
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:
parent
4e1065491b
commit
33a68eaaf4
1 changed files with 6 additions and 1 deletions
|
|
@ -4287,7 +4287,12 @@ display_create(int argc, char *argv[])
|
||||||
|
|
||||||
d->registry = wl_display_get_registry(d->display);
|
d->registry = wl_display_get_registry(d->display);
|
||||||
wl_registry_add_listener(d->registry, ®istry_listener, d);
|
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
|
#ifdef HAVE_CAIRO_EGL
|
||||||
if (init_egl(d) < 0)
|
if (init_egl(d) < 0)
|
||||||
fprintf(stderr, "EGL does not seem to work, "
|
fprintf(stderr, "EGL does not seem to work, "
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue