aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-04-16 13:23:50 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-04-30 16:38:43 +1000
commit1cc0651e1b44af505d7177b22c6083eae9b118cc (patch)
treec0ad4be111f8779d4123351307318164d5e4b196
parentPre-allocate the reopen timer so we don't allocate during sigio handling. (diff)
downloadxf86-input-evdev-1cc0651e1b44af505d7177b22c6083eae9b118cc.tar.gz
xf86-input-evdev-1cc0651e1b44af505d7177b22c6083eae9b118cc.tar.bz2
xf86-input-evdev-1cc0651e1b44af505d7177b22c6083eae9b118cc.zip
Print read errors as X_NONE to avoid mallocs in the server.
Messages of type X_NONE are just passed down to the log files, everything else gets the (EE) or (II) prefixed. Since this mallocs, we can't use it in the signal handler. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 220e2dfb8f6aa08bd5f59e81c6883c057b945721)
-rw-r--r--src/evdev.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/evdev.c b/src/evdev.c
index a05bd2c..9fc0663 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -577,15 +577,19 @@ EvdevReadInput(InputInfoPtr pInfo)
pEvdev->reopen_timer = TimerSet(pEvdev->reopen_timer, 0, 100, EvdevReopenTimer, pInfo);
}
} else if (errno != EAGAIN)
- xf86Msg(X_ERROR, "%s: Read error: %s\n", pInfo->name,
+ {
+ /* We use X_NONE here because it doesn't alloc */
+ xf86MsgVerb(X_NONE, 0, "%s: Read error: %s\n", pInfo->name,
strerror(errno));
+ }
break;
}
+ /* The kernel promises that we always only read a complete
+ * event, so len != sizeof ev is an error. */
if (len % sizeof(ev[0])) {
- /* The kernel promises that we always only read a complete
- * event, so len != sizeof ev is an error. */
- xf86Msg(X_ERROR, "%s: Read error: %s\n", pInfo->name, strerror(errno));
+ /* We use X_NONE here because it doesn't alloc */
+ xf86MsgVerb(X_NONE, 0, "%s: Read error: %s\n", pInfo->name, strerror(errno));
break;
}