summaryrefslogtreecommitdiff
path: root/src/xcb_util.c
diff options
context:
space:
mode:
authorArvind Umrao <arvind.umrao@oracle.com>2011-11-04 15:42:05 +0530
committerJulien Danjou <julien@danjou.info>2012-01-11 18:01:29 +0100
commit769acff0da8b9859ebdf052dce80045465c7598c (patch)
treeda557d02c65a7f3ba8dfd73284c0300f780593a1 /src/xcb_util.c
parent9b4d6f30a339e2d18ebaea98149da81aba453216 (diff)
Added more error states and removed global error_connection
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=41443 Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=42304 I have added more xcb connection error states at xcb.h header. Also I have removed global error_connection variable, and added an interface that returns connection error state. TBD: I will segregate errors states in a separate header file and try to provide more precise error states, in future. Also I will give patch for libX11, in that patch xcb_connection_t::has_error will be passed to default io handler of libX11. This value can then be used for displaying error messages. Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi> Reviewed-by: Uli Schlachter <psychon@znc.in> Signed-off-by: Arvind Umrao <arvind.umrao@oracle.com>
Diffstat (limited to 'src/xcb_util.c')
-rw-r--r--src/xcb_util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/xcb_util.c b/src/xcb_util.c
index fcb11f0..a55df16 100644
--- a/src/xcb_util.c
+++ b/src/xcb_util.c
@@ -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;
}