Input: evdev - if no events and non-block, return EAGAIN not 0

Signed-off-by: Dima Zavin <dima@android.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
Dima Zavin 2011-12-30 15:16:44 -08:00 committed by Dmitry Torokhov
parent 566cf5b6e3
commit e90f869cae
1 changed files with 3 additions and 0 deletions

View File

@ -412,6 +412,9 @@ static ssize_t evdev_read(struct file *file, char __user *buffer,
retval += input_event_size();
}
if (retval == 0 && (file->f_flags & O_NONBLOCK))
return -EAGAIN;
return retval;
}