From: Dima Zavin Date: Fri, 30 Dec 2011 23:16:44 +0000 (-0800) Subject: Input: evdev - if no events and non-block, return EAGAIN not 0 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e90f869cae3b4aedf0f6d2ca8048d60245ee77f7;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git Input: evdev - if no events and non-block, return EAGAIN not 0 Signed-off-by: Dima Zavin Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index 03344b3c7c15..a9d871651ce7 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -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; }