aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZephaniah E. Hull <warp@aehallh.com>2006-02-27 10:48:40 +0000
committerZephaniah E. Hull <warp@aehallh.com>2006-02-27 10:48:40 +0000
commit94cb4aa1f8caf1ba141ab0839c9eb0b2b5357470 (patch)
treeaa263b30027b866923b226505bd91266be9f6c20 /src
parentCompile with -Wall now. Add evdev.h to the sources so that make distcheck (diff)
downloadxf86-input-evdev-94cb4aa1f8caf1ba141ab0839c9eb0b2b5357470.tar.gz
xf86-input-evdev-94cb4aa1f8caf1ba141ab0839c9eb0b2b5357470.tar.bz2
xf86-input-evdev-94cb4aa1f8caf1ba141ab0839c9eb0b2b5357470.zip
Better error reporting if the read fails.
Work properly if we're defining entirely by capability maps.
Diffstat (limited to 'src')
-rw-r--r--src/evdev.c7
-rw-r--r--src/evdev_brain.c3
2 files changed, 7 insertions, 3 deletions
diff --git a/src/evdev.c b/src/evdev.c
index fa5a1d9..3a2e397 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -89,11 +89,12 @@ EvdevReadInput(InputInfoPtr pInfo)
int len, value;
while (xf86WaitForInput (pInfo->fd, 0) > 0) {
- len = read(pInfo->fd, &ev, sizeof ev);
- if (len != sizeof ev) {
+ len = read(pInfo->fd, &ev, sizeof(ev));
+ if (len != sizeof(ev)) {
/* The kernel promises that we always only read a complete
* event, so len != sizeof ev is an error. */
- xf86Msg(X_ERROR, "Read error: %s\n", strerror(errno));
+ xf86Msg(X_ERROR, "Read error: %s (%d, %d != %ld)\n",
+ strerror(errno), errno, len, sizeof (ev));
break;
}
diff --git a/src/evdev_brain.c b/src/evdev_brain.c
index 7a20c68..04cc542 100644
--- a/src/evdev_brain.c
+++ b/src/evdev_brain.c
@@ -427,8 +427,11 @@ evdevNewDriver (evdevDriverPtr driver)
{
if (!evdev_alive)
return FALSE;
+ /* FIXME: Make this check valid given all the ways to look. */
+#if 0
if (!(driver->name || driver->phys || driver->device))
return FALSE;
+#endif
if (!driver->callback)
return FALSE;