summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Cristau <jcristau@debian.org>2010-09-25 16:05:07 +0200
committerJulien Cristau <jcristau@debian.org>2010-10-20 21:42:52 +0200
commitbc195095e2ccd388a654d50366490114aad2b673 (patch)
treea5340821ed856ba6e3e24c1264c169b1f5a276b9
parent8b87d7655a0e828b7caa27ee05460ed88bae29b7 (diff)
Xephyr: handle errors in event loop
Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
-rw-r--r--hw/kdrive/ephyr/hostx.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index c17e4157e..db1359c76 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 & 0x7f)
{
+ 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,
+ e->resource_id);
+ free(xev);
+ exit(1);
+ }
case XCB_EXPOSE:
{
xcb_expose_event_t *expose = (xcb_expose_event_t *)xev;