Skip to content

Commit e90f869

Browse files
Dima Zavindtor
authored andcommitted
Input: evdev - if no events and non-block, return EAGAIN not 0
Signed-off-by: Dima Zavin <dima@android.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
1 parent 566cf5b commit e90f869

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎drivers/input/evdev.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,9 @@ static ssize_t evdev_read(struct file *file, char __user *buffer,
412412
retval += input_event_size();
413413
}
414414

415+
if (retval == 0 && (file->f_flags & O_NONBLOCK))
416+
return -EAGAIN;
417+
415418
return retval;
416419
}
417420

0 commit comments

Comments
 (0)