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-16 13:44:07 +1000 |
commit | 220e2dfb8f6aa08bd5f59e81c6883c057b945721 (patch) | |
tree | 89e742baa134fa8e0a4929005aeb38283c959ac3 | |
parent | ddc126637404cb3d9356b7698779dcd8849f8718 (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>
-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 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; } |