check if we connected to a display correctly
authorDana Jansens <danakj@orodu.net>
Tue, 4 Mar 2008 21:34:36 +0000 (16:34 -0500)
committerDana Jansens <danakj@orodu.net>
Tue, 4 Mar 2008 21:35:01 +0000 (16:35 -0500)
display.c

index 5891fd4..be05baf 100644 (file)
--- a/display.c
+++ b/display.c
@@ -169,7 +169,7 @@ display_open(const char *name)
     xcb_connection_t *conn;
 
     conn = xcb_connect(name, NULL);
-    if (conn) {
+    if (conn && !xcb_connection_has_error(conn)) {
         dpy = malloc(sizeof(d_display_t));
         dpy->conn = conn;
         dpy->ref = 1;