[Xcb] [PATCH:app/xlsclients] Fix check for xcb_connect failure

Alan Coopersmith alan.coopersmith at sun.com
Tue Oct 20 16:22:36 PDT 2009


Prevents core dump when display can't be opened

Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>
---
 xlsclients.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xlsclients.c b/xlsclients.c
index 049bc4c..00657aa 100644
--- a/xlsclients.c
+++ b/xlsclients.c
@@ -178,7 +178,7 @@ main(int argc, char *argv[])
     }
 
     dpy = xcb_connect(displayname, &screen_number);
-    if (!dpy) {
+    if (xcb_connection_has_error(dpy)) {
 	char *name = displayname;
 	if (!name)
 	    name = getenv("DISPLAY");
-- 
1.5.6.5



More information about the Xcb mailing list