aboutsummaryrefslogtreecommitdiff
path: root/src/evdev.c
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/evdev.c
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/evdev.c')
-rw-r--r--src/evdev.c7
1 files changed, 4 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;
}