mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2026-05-09 08:18:07 +02:00
Return -EBADF for functions that need the fd initialized
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
parent
2c101977b7
commit
22d2a735c4
1 changed files with 9 additions and 0 deletions
|
|
@ -1130,6 +1130,9 @@ libevdev_kernel_set_abs_info(struct libevdev *dev, unsigned int code, const stru
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
if (dev->fd < 0)
|
||||||
|
return -EBADF;
|
||||||
|
|
||||||
if (code > ABS_MAX)
|
if (code > ABS_MAX)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
|
@ -1147,6 +1150,9 @@ libevdev_grab(struct libevdev *dev, enum libevdev_grab_mode grab)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
|
if (dev->fd < 0)
|
||||||
|
return -EBADF;
|
||||||
|
|
||||||
if (grab != LIBEVDEV_GRAB && grab != LIBEVDEV_UNGRAB)
|
if (grab != LIBEVDEV_GRAB && grab != LIBEVDEV_UNGRAB)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
|
@ -1250,6 +1256,9 @@ libevdev_kernel_set_led_values(struct libevdev *dev, ...)
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
size_t nleds = 0;
|
size_t nleds = 0;
|
||||||
|
|
||||||
|
if (dev->fd < 0)
|
||||||
|
return -EBADF;
|
||||||
|
|
||||||
memset(ev, 0, sizeof(ev));
|
memset(ev, 0, sizeof(ev));
|
||||||
|
|
||||||
va_start(args, dev);
|
va_start(args, dev);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue