diff options
-rw-r--r-- | src/wcmUSB.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/wcmUSB.c b/src/wcmUSB.c index 8451c25..b817409 100644 --- a/src/wcmUSB.c +++ b/src/wcmUSB.c @@ -1556,11 +1556,18 @@ static void usbDispatchEvents(InputInfoPtr pInfo) if (!ds->device_type && !dslast.proximity) { unsigned long keys[NBITS(KEY_MAX)] = { 0 }; + int rc; /* Retrieve the type by asking a resend from the kernel */ - ioctl(common->fd, EVIOCGKEY(sizeof(keys)), keys); + rc = ioctl(common->fd, EVIOCGKEY(sizeof(keys)), keys); + if (rc == -1) + { + xf86Msg(X_ERROR, "%s: failed to retrieve key bits\n", + pInfo->name); + return; + } - for (i=0; i < ARRAY_SIZE(wcmTypeToKey); i++) + for (i = 0; i < ARRAY_SIZE(wcmTypeToKey); i++) { if (ISBITSET(keys, wcmTypeToKey[i].tool_key)) { |