diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-04-16 13:23:50 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-04-30 16:38:43 +1000 |
commit | 1cc0651e1b44af505d7177b22c6083eae9b118cc (patch) | |
tree | c0ad4be111f8779d4123351307318164d5e4b196 | |
parent | 48a747ea8603ece6bd25ba5b1ce92c2eb91a7c01 (diff) |
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.c | 12 |
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; } |