aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-05-31 17:52:41 -0700
committerPeter Hutterer <peter.hutterer@who-t.net>2016-06-02 09:41:25 +1000
commite08b0332761b0cff6d6a3f5d7e88c22f786bd530 (patch)
treef215d8a07f3cf5c3398d573078ed2c215a0ddb44
parentevdev 2.10.3 (diff)
downloadxf86-input-evdev-e08b0332761b0cff6d6a3f5d7e88c22f786bd530.tar.gz
xf86-input-evdev-e08b0332761b0cff6d6a3f5d7e88c22f786bd530.tar.bz2
xf86-input-evdev-e08b0332761b0cff6d6a3f5d7e88c22f786bd530.zip
Report errors when attempting to write keyboard controls
This is mostly to eliminate a compiler warning. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/evdev.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 341db61..5ace238 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1108,6 +1108,7 @@ EvdevKbdCtrl(DeviceIntPtr device, KeybdCtrl *ctrl)
InputInfoPtr pInfo;
struct input_event ev[ArrayLength(bits) + 1];
int i;
+ int rc;
memset(ev, 0, sizeof(ev));
@@ -1122,7 +1123,9 @@ EvdevKbdCtrl(DeviceIntPtr device, KeybdCtrl *ctrl)
ev[i].code = SYN_REPORT;
ev[i].value = 0;
- write(pInfo->fd, ev, sizeof ev);
+ rc = write(pInfo->fd, ev, sizeof ev);
+ if (rc != sizeof ev)
+ xf86IDrvMsg(pInfo, X_ERROR, "Failed to set keyboard controls: %s\n", strerror(errno));
}
static int