From 220e2dfb8f6aa08bd5f59e81c6883c057b945721 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 16 Apr 2009 13:23:50 +1000 Subject: 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 --- src/evdev.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/evdev.c b/src/evdev.c index 6ef1316..c5772d1 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -578,15 +578,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; } -- cgit v1.2.3