chiark / gitweb /
libudev: enumerate - do not ignore other matches when add_match_tag() is used
authorKay Sievers <kay.sievers@vrfy.org>
Thu, 26 May 2011 00:15:43 +0000 (02:15 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Thu, 26 May 2011 00:15:43 +0000 (02:15 +0200)
libudev/libudev-enumerate.c

index 12de24e..6e51726 100644 (file)
@@ -765,7 +765,18 @@ UDEV_EXPORT int udev_enumerate_scan_devices(struct udev_enumerate *udev_enumerat
                                dev = udev_device_new_from_id_filename(udev_enumerate->udev, dent->d_name);
                                if (dev == NULL)
                                        continue;
+
+                               if (!match_subsystem(udev_enumerate, udev_device_get_subsystem(dev)))
+                                       goto nomatch;
+                               if (!match_sysname(udev_enumerate, udev_device_get_sysname(dev)))
+                                       goto nomatch;
+                               if (!match_property(udev_enumerate, dev))
+                                       goto nomatch;
+                               if (!match_sysattr(udev_enumerate, dev))
+                                       goto nomatch;
+
                                syspath_add(udev_enumerate, udev_device_get_syspath(dev));
+nomatch:
                                udev_device_unref(dev);
                        }
                        closedir(dir);