Prevent input_server from hogging the CPU when input devices fail.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14476 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Marcus Overhagen
2005-10-23 00:28:14 +00:00
parent a21a8b1324
commit 106d748c45
5 changed files with 22 additions and 17 deletions
@@ -339,8 +339,10 @@ MouseInputDevice::DeviceWatcher(void *arg)
BMessage *message = NULL;
while (dev->active) {
memset(&movements, 0, sizeof(movements));
if (ioctl(dev->fd, MS_READ, &movements) < B_OK)
if (ioctl(dev->fd, MS_READ, &movements) != B_OK) {
snooze(10000); // this is a realtime thread, and something is wrong...
continue;
}
uint32 buttons = buttons_state ^ movements.buttons;