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

Alan Coopersmith alan.coopersmith at oracle.com
Mon Oct 24 09:46:02 PDT 2011


On 10/24/11 01:01, Arvind Umrao wrote:
> 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.h      |   20 +++++++++++++++++---
>   src/xcb_conn.c |    8 ++++----
>   src/xcb_in.c   |   14 +++++++-------
>   src/xcb_out.c  |    4 ++--
>   src/xcbint.h   |    2 +-
>   5 files changed, 31 insertions(+), 17 deletions(-)
>
> diff --git a/src/xcb.h b/src/xcb.h
> index 3ee7965..24624bf 100644
> --- a/src/xcb.h
> +++ b/src/xcb.h
> @@ -69,6 +69,18 @@ extern "C" {
>   /** X_TCP_PORT + display number = server port for TCP transport */
>   #define X_TCP_PORT 6000
>
> +/** xcb connection shutdown because of connection errors for eg socket errors, pipe errors and other stream errors. */
> +#define CONN_ERROR  1
> +
> +/**  xcb connection shutdown because of extension not sppported */
> +#define CONN_CLOSED_EXT_NOTSUPPORTED 2
> +
> +/** malloc(), calloc() and realloc() error upon failure, for eg ENOMEM */
> +#define CONN_CLOSED_MEMORY_INSUFFICIENT 3
> +
> +/** Connection closed, exceeding request length that server accepts.  */
> +#define CONN_CLOSED_REQ_LEN_EXCEED  4
> +

Should those be XCB_CONN_* to avoid namespace clashes with other connection code?


-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the Xcb mailing list