Added more error states and removed global error_connection
[free-sw/xcb/libxcb] / src / xcb_util.c
index fcb11f0..a55df16 100644 (file)
@@ -424,13 +424,13 @@ xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *displayname,
     int parsed = _xcb_parse_display(displayname, &host, &protocol, &display, screenp);
     
     if(!parsed) {
-        c = (xcb_connection_t *) &error_connection;
+        c = _xcb_conn_ret_error(XCB_CONN_CLOSED_PARSE_ERR);
         goto out;
     } else
         fd = _xcb_open(host, protocol, display);
 
     if(fd == -1) {
-        c = (xcb_connection_t *) &error_connection;
+        c = _xcb_conn_ret_error(XCB_CONN_ERROR);
         goto out;
     }