diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2012-11-30 10:32:47 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2012-12-05 17:12:34 +1000 |
commit | 0d6c6b59c153cb53b53d6860387b4fe40d245628 (patch) | |
tree | b50a2f53bd77988ff946a7c3ab02f2fddc79d6a2 | |
parent | c263d6e46d76b3e54570da637b1e7352437bb59d (diff) |
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 <peter.hutterer@who-t.net>
-rw-r--r-- | src/evdev.c | 4 |
1 files changed, 3 insertions, 1 deletions
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) |