[Xcb] [PATCH xcb/libxcb] Fatal error message when we close libX11 window application

Arvind Umrao arvind.umrao at oracle.com
Mon Oct 17 03:44:09 PDT 2011


Fixes:https://bugs.freedesktop.org/show_bug.cgi?id=41443

When we close any libX11 window application, we get fatal error.
XIO:  fatal IO error 11 (Resource temporarily unavailable).
Fatal error messages are strange and confusing to developers.
Error is simply because we quit the application, without exiting
while loop of XNextEvent. XCB should give same error messages as
legacy libX11 were. In order to fix this issue, I have set right error
number at xcb_connection_t::has_error.This xcb_connection_t::has_error
will be passed to default io handler of libX11, This value could then
be used to display corrrect error messages in default IO error
handler of libX11.

Signed-off-by: Arvind Umrao <arvind.umrao at oracle.com>
---
 src/xcb_conn.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/xcb_conn.c b/src/xcb_conn.c
index 3ab5385..a4136e4 100644
--- a/src/xcb_conn.c
+++ b/src/xcb_conn.c
@@ -319,7 +319,7 @@ void xcb_disconnect(xcb_connection_t *c)
 
 void _xcb_conn_shutdown(xcb_connection_t *c)
 {
-    c->has_error = 1;
+    c->has_error = EPIPE;
 }
 
 int _xcb_conn_wait(xcb_connection_t *c, pthread_cond_t *cond, struct iovec **vector, int *count)
-- 
1.7.3.2



More information about the Xcb mailing list