summaryrefslogtreecommitdiff
path: root/libudev
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2011-05-26 02:15:43 +0200
committerKay Sievers <kay.sievers@vrfy.org>2011-05-26 02:15:43 +0200
commit19e47d97256390e4f42c5a4c96e26536d4d33e3e (patch)
treee315743a71260cb014ac568b8a20591ea859dc3b /libudev
parent7df0ed83c113e4744786e7804d398d9d34b43281 (diff)
libudev: enumerate - do not ignore other matches when add_match_tag() is used
Diffstat (limited to 'libudev')
-rw-r--r--libudev/libudev-enumerate.c11
1 files changed, 11 insertions, 0 deletions
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);