Thread (3 messages) 3 messages, 1 author, 2011-12-16

[PATCH 2/3] input: evdev: if no events and non-block, return EAGAIN not 0

flat view
DORMANTno replies

From: Dima Zavin <hidden>
Date: 2011-12-16 18:07:34
Also in: lkml
Subsystem: input (keyboard, mouse, joystick, touchscreen) drivers, the rest · Maintainers: Dmitry Torokhov, Linus Torvalds

Cc: Jeff Brown <redacted>
Signed-off-by: Dima Zavin <redacted>
---
 drivers/input/evdev.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 03344b3..2e563af 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -412,6 +412,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;
 }
 
-- 
1.7.3.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help