From: José Fonseca Date: Wed, 20 Apr 2011 20:05:16 +0000 (+0100) Subject: Print an error message when not able to open X display. X-Git-Tag: 2.0_alpha^2~1038 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=08005d711a6ff78d44667048a9239c808549c97e;p=tools%2Fapitrace.git Print an error message when not able to open X display. --- diff --git a/glws_glx.cpp b/glws_glx.cpp index 661e77d..64f8ce1 100644 --- a/glws_glx.cpp +++ b/glws_glx.cpp @@ -23,6 +23,9 @@ * **************************************************************************/ +#include +#include + #include "glimports.hpp" #include "glws.hpp" @@ -102,6 +105,10 @@ private: public: GlxWindowSystem() { display = XOpenDisplay(NULL); + if (!display) { + std::cerr << "error: unable to open display " << XDisplayName(NULL) << "\n"; + exit(1); + } screen = DefaultScreen(display); }