ecore_x/xcb: Do not segfault if unable to connect to display
authordottedmag <dottedmag@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 13 Jan 2010 20:24:48 +0000 (20:24 +0000)
committerdottedmag <dottedmag@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 13 Jan 2010 20:24:48 +0000 (20:24 +0000)
There is xcb_connection_has_error to check connection errors,
and return value of xcb_connect is always non-NULL.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@45088 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore_x/xcb/ecore_xcb.c

index f5a667d..68a2866 100644 (file)
@@ -203,7 +203,7 @@ ecore_x_init(const char *name)
        return --_ecore_xcb_init_count;
      }
    _ecore_xcb_conn = xcb_connect(name, &screen);
-   if (!_ecore_xcb_conn) {
+   if (xcb_connection_has_error(_ecore_xcb_conn)) {
      eina_log_domain_unregister(_ecore_x11xcb_log_dom);
      _ecore_x11xcb_log_dom = -1;
      return --_ecore_xcb_init_count;