summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-03-21 15:28:17 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-03-21 15:56:44 +1000
commit67e1fef9d3f35edaeab71247d9c888074130f61e (patch)
tree95915ade8bc6df2699b7c1b34653cfcfda5dfb64
parentb8e0add9ab4611a8dd75cce18709061b030096a1 (diff)
downloadxf86-input-wacom-67e1fef9d3f35edaeab71247d9c888074130f61e.tar.gz
Check ioctl return value
Really, this shouldn't ever fail but at least it shuts up some static analysers. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/wcmUSB.c11
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))
{