From: Dima Zavin Date: Wed, 5 Oct 2011 05:31:48 +0000 (-0700) Subject: input: evdev: if no events and non-block, return EAGAIN not 0 X-Git-Tag: firefly_0821_release~7613^2~279 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=587b1eb1629612189c8b278d4efee952bcf73b4f;p=firefly-linux-kernel-4.4.55.git input: evdev: if no events and non-block, return EAGAIN not 0 Change-Id: I5f0da721f74e5de111cffc7e7b375b72dd80e530 Signed-off-by: Dima Zavin --- diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index 13a741ae6045..10ae1c966a35 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -426,6 +426,8 @@ static ssize_t evdev_read(struct file *file, char __user *buffer, retval += input_event_size(); } + if (retval == 0 && file->f_flags & O_NONBLOCK) + retval = -EAGAIN; return retval; }