From 513a9dab254cf9eec103bcc77ff307a242bc2420 Mon Sep 17 00:00:00 2001 From: Mikhail Gusarov Date: Wed, 13 Jan 2010 20:24:48 +0000 Subject: [PATCH] ecore_x/xcb: Do not segfault if unable to connect to display There is xcb_connection_has_error to check connection errors, and return value of xcb_connect is always non-NULL. SVN revision: 45088 --- legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb.c b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb.c index f5a667de06..68a28666e0 100644 --- a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb.c +++ b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb.c @@ -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;