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 <[email protected]>
---
This patch is to shut up coverity

 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)
-- 
1.7.11.7

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to