[Xcb] [PATCH 18/19] Xephyr: handle errors in event loop

Alan Coopersmith alan.coopersmith at oracle.com
Wed Oct 20 10:38:37 PDT 2010


Julien Cristau wrote:
> Signed-off-by: Julien Cristau <jcristau at debian.org>
> ---
>  hw/kdrive/ephyr/hostx.c |   15 +++++++++++++++
>  1 files changed, 15 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
> index 0dd5105..5ce5c4c 100644
> --- a/hw/kdrive/ephyr/hostx.c
> +++ b/hw/kdrive/ephyr/hostx.c
> @@ -966,6 +966,21 @@ hostx_get_event(EphyrHostXEvent *ev)
>      {
>        switch (xev->response_type)
>  	{
> +	case 0: /* error */
> +	  {
> +	    xcb_generic_error_t *e = (xcb_generic_error_t *)xev;
> +	    fprintf(stderr, "X11 error\n"
> +	                    "Error code: %hhu\n"
> +			    "Sequence number: %hu\n"
> +			    "Major code: %hhu\tMinor code: %hu\n"
> +			    "Error value: %u\n",
> +			    e->error_code,
> +			    e->sequence,
> +			    e->major_code, e->minor_code,

Does minor code have any meaning when major_code < 128?   I suppose
it doesn't hurt to print it.   I do wish there was an easy way to
print the extension name for major_code >= 128, similar to the old
Xlib error handler, since we get bug reports from users with different
configs, so have to guess what extension an error came from.

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



More information about the Xcb mailing list