From e19229a9f1f69d9f486c8adbba17a4b6ab3cb26b Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Wed, 6 Apr 2011 10:39:40 +0200 Subject: qFatal() if no connection to wayland is available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit abort here is the only thing that makes sense, otherwise, we'll get crashes all over Qt. Reviewed-by: Jørgen Lind --- src/plugins/platforms/wayland/qwaylanddisplay.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.cpp b/src/plugins/platforms/wayland/qwaylanddisplay.cpp index b79f355..1c1702f 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay.cpp +++ b/src/plugins/platforms/wayland/qwaylanddisplay.cpp @@ -53,6 +53,7 @@ #include #include #include +#include struct wl_surface *QWaylandDisplay::createSurface(void *handle) { @@ -186,8 +187,8 @@ QWaylandDisplay::QWaylandDisplay(void) { mDisplay = wl_display_connect(NULL); if (mDisplay == NULL) { - fprintf(stderr, "failed to create display: %m\n"); - return; + qErrnoWarning(errno, "Failed to create display"); + qFatal("No wayland connection available."); } wl_display_add_global_listener(mDisplay, -- cgit v0.12