mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2025-12-24 19:20:06 +01:00
Return EBADF when trying to read from an uninitalized device
All other functions that check the fd for validity return EBADF, which also makes it easier to debug if the actual device goes away. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
parent
9675287062
commit
2c101977b7
1 changed files with 1 additions and 1 deletions
|
|
@ -663,7 +663,7 @@ libevdev_next_event(struct libevdev *dev, unsigned int flags, struct input_event
|
|||
int rc = 0;
|
||||
|
||||
if (dev->fd < 0)
|
||||
return -ENODEV;
|
||||
return -EBADF;
|
||||
|
||||
if (!(flags & (LIBEVDEV_READ_NORMAL|LIBEVDEV_READ_SYNC|LIBEVDEV_FORCE_SYNC)))
|
||||
return -EINVAL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue