From 0d6c6b59c153cb53b53d6860387b4fe40d245628 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 30 Nov 2012 10:32:47 +1000 Subject: If stat fails, pretend it's not a virtual device If stat fails while checking if the device is virtual, just say "no, it's not virtual" and continue. If the device really went away, it'll be removed through other means. Signed-off-by: Peter Hutterer --- src/evdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/evdev.c b/src/evdev.c index 2aab97f..619bce6 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -308,7 +308,9 @@ EvdevDeviceIsVirtual(const char* devicenode) if (!udev) goto out; - stat(devicenode, &st); + if (stat(devicenode, &st) == -1) + goto out; + device = udev_device_new_from_devnum(udev, 'c', st.st_rdev); if (!device) -- cgit v1.2.3