devilhorns pushed a commit to branch master.

commit 684d5180c3bcd6054fc9a3bb9dae24f389fbac76
Author: Chris Michael <>
Date:   Fri Jan 29 13:46:30 2016 -0500

    eeze: Fix eeze_udev_find_by_subsystem_sysname function
    This function was severly broken when used for finding devices of a
    particular subsystem. Previously, this function would return every
    device in the system, regardless if subsystem or sysname was passed in.
    This patch fixes the issue by adding udev_enumerate matches before we
    scan for devices. This way, when we enumerate the scan results, we now
    get only devices that match the subsystem (if supplied).
    Signed-off-by: Chris Michael <>
 src/lib/eeze/eeze_udev_find.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/lib/eeze/eeze_udev_find.c b/src/lib/eeze/eeze_udev_find.c
index 06bbb4c..3df74cd 100644
--- a/src/lib/eeze/eeze_udev_find.c
+++ b/src/lib/eeze/eeze_udev_find.c
@@ -392,18 +392,19 @@ eeze_udev_find_by_subsystem_sysname(const char 
*subsystem, const char *sysname)
    const char *devname;
    Eina_List *ret = NULL;
-   if (!sysname) return NULL;
    en = udev_enumerate_new(udev);
    if (!en) return NULL;
+   if (subsystem) udev_enumerate_add_match_subsystem(en, subsystem);
+   if (sysname) udev_enumerate_add_match_sysname(en, sysname);
    devs = udev_enumerate_get_list_entry(en);
    udev_list_entry_foreach(cur, devs)
         devname = udev_list_entry_get_name(cur);
-        device = 
-          udev_device_new_from_subsystem_sysname(udev, subsystem, sysname);
+        device = udev_device_new_from_syspath(udev, devname);
+        if (!device) continue;
         ret = eina_list_append(ret, eina_stringshare_add(devname));


Reply via email to