Skip to content

Commit

Permalink
Input: evdev - if no events and non-block, return EAGAIN not 0
Browse files Browse the repository at this point in the history
Signed-off-by: Dima Zavin <dima@android.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Dima Zavin authored and Dmitry Torokhov committed Dec 30, 2011
1 parent 566cf5b commit e90f869
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/input/evdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit e90f869

Please sign in to comment.