From 19e47d97256390e4f42c5a4c96e26536d4d33e3e Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Thu, 26 May 2011 02:15:43 +0200 Subject: libudev: enumerate - do not ignore other matches when add_match_tag() is used --- libudev/libudev-enumerate.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libudev/libudev-enumerate.c') diff --git a/libudev/libudev-enumerate.c b/libudev/libudev-enumerate.c index 12de24e244..6e51726f08 100644 --- a/libudev/libudev-enumerate.c +++ b/libudev/libudev-enumerate.c @@ -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); -- cgit v1.2.3-54-g00ecf