input: evdev: do not block waiting for an event if fd is nonblock
authorDima Zavin <dima@android.com>
Wed, 5 Oct 2011 00:10:45 +0000 (17:10 -0700)
committerDima Zavin <dima@android.com>
Wed, 5 Oct 2011 05:51:05 +0000 (22:51 -0700)
commit183a1fcfd801a204c86edfbf55c2b902cc028007
tree8d80a2775d3e0dcb26329629d7577b38f9f0b0c8
parent587b1eb1629612189c8b278d4efee952bcf73b4f
input: evdev: do not block waiting for an event if fd is nonblock

If there is a full packet in the buffer, and we overflow that buffer
right after checking for that condition, it would have been possible
for us to block indefinitely (rather, until the next full packet) even if
the file was marked as O_NONBLOCK.

Change-Id: Icd0f59f8cc98392be4c4d13bd45b5cf94317eb5a
Signed-off-by: Dima Zavin <dima@android.com>
drivers/input/evdev.c