From 769acff0da8b9859ebdf052dce80045465c7598c Mon Sep 17 00:00:00 2001 From: Arvind Umrao Date: Fri, 4 Nov 2011 15:42:05 +0530 Subject: Added more error states and removed global error_connection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Uli Schlachter Signed-off-by: Arvind Umrao --- src/xcb_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/xcb_util.c') 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; } -- cgit v1.2.3