aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/inpututils.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-05-16 08:06:12 +0000
committermarha <marha@users.sourceforge.net>2011-05-16 08:06:12 +0000
commit08cbf3b50bfe713044f36b363c73768cd042f13c (patch)
tree6be4c5dd7f5bc2f058228b2a2fa747a4d7666dc5 /xorg-server/dix/inpututils.c
parentd8c3e3d2ba88d6b87a718aef7f4fb4627113eb52 (diff)
downloadvcxsrv-08cbf3b50bfe713044f36b363c73768cd042f13c.tar.gz
vcxsrv-08cbf3b50bfe713044f36b363c73768cd042f13c.tar.bz2
vcxsrv-08cbf3b50bfe713044f36b363c73768cd042f13c.zip
xserver xkeyboar-config mesa git update 16 May 2011
Diffstat (limited to 'xorg-server/dix/inpututils.c')
-rw-r--r--xorg-server/dix/inpututils.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/xorg-server/dix/inpututils.c b/xorg-server/dix/inpututils.c
index 077ffce01..aeace6ef8 100644
--- a/xorg-server/dix/inpututils.c
+++ b/xorg-server/dix/inpututils.c
@@ -36,6 +36,7 @@
#include "xkbsrv.h"
#include "xkbstr.h"
#include "inpututils.h"
+#include "eventstr.h"
/* Check if a button map change is okay with the device.
* Returns -1 for BadValue, as it collides with MappingBusy. */
@@ -556,3 +557,30 @@ CountBits(const uint8_t *mask, int len)
return ret;
}
+
+/**
+ * Verifies sanity of the event. If the event is not an internal event,
+ * memdumps the first 32 bytes of event to the log, a backtrace, then kill
+ * the server.
+ */
+void verify_internal_event(const InternalEvent *ev)
+{
+ if (ev && ev->any.header != ET_Internal)
+ {
+ int i;
+ unsigned char *data = (unsigned char*)ev;
+
+ ErrorF("dix: invalid event type %d\n", ev->any.header);
+
+ for (i = 0; i < sizeof(xEvent); i++, data++)
+ {
+ ErrorF("%02hx ", *data);
+
+ if ((i % 8) == 7)
+ ErrorF("\n");
+ }
+
+ xorg_backtrace();
+ FatalError("Wrong event type %d. Aborting server\n", ev->any.header);
+ }
+}