mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
(udev) Avoid warning with helgrind - input descriptor -1 is invalid
This commit is contained in:
parent
d903b1cc60
commit
c3c772a79a
@ -774,12 +774,15 @@ static bool open_devices(udev_input_t *udev,
|
|||||||
{
|
{
|
||||||
int fd = open(devnode, O_RDONLY | O_NONBLOCK);
|
int fd = open(devnode, O_RDONLY | O_NONBLOCK);
|
||||||
|
|
||||||
RARCH_LOG("[udev] Adding device %s as type %s.\n",
|
if (fd != -1)
|
||||||
devnode, type_str);
|
{
|
||||||
if (!udev_input_add_device(udev, type, devnode, cb))
|
RARCH_LOG("[udev] Adding device %s as type %s.\n",
|
||||||
RARCH_ERR("[udev] Failed to open device: %s (%s).\n",
|
devnode, type_str);
|
||||||
devnode, strerror(errno));
|
if (!udev_input_add_device(udev, type, devnode, cb))
|
||||||
close(fd);
|
RARCH_ERR("[udev] Failed to open device: %s (%s).\n",
|
||||||
|
devnode, strerror(errno));
|
||||||
|
close(fd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
udev_device_unref(dev);
|
udev_device_unref(dev);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user