]> err.no Git - systemd/commitdiff
logind: use new udev_enumerate_add_match_parent() where applicable
authorLennart Poettering <lennart@poettering.net>
Wed, 13 Jul 2011 19:49:21 +0000 (21:49 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 13 Jul 2011 19:49:21 +0000 (21:49 +0200)
src/logind-dbus.c
src/logind.h

index e0855f4cf82fc616b965335c821204189da3f86d..4321ffd90043906f4736f0de0790a7e35e569083 100644 (file)
@@ -550,7 +550,7 @@ fail:
         return r;
 }
 
-static int trigger_device(Manager *m, const char *prefix) {
+static int trigger_device(Manager *m, struct udev_device *d) {
         struct udev_enumerate *e;
         struct udev_list_entry *first, *item;
         int r;
@@ -563,6 +563,14 @@ static int trigger_device(Manager *m, const char *prefix) {
                 goto finish;
         }
 
+        if (d) {
+                if (udev_enumerate_add_match_parent(e, d) < 0) {
+                        r = -EIO;
+                        goto finish;
+                }
+        }
+
+
         if (udev_enumerate_scan_devices(e) < 0) {
                 r = -EIO;
                 goto finish;
@@ -575,9 +583,6 @@ static int trigger_device(Manager *m, const char *prefix) {
 
                 p = udev_list_entry_get_name(item);
 
-                if (prefix && !path_startswith(p, prefix))
-                        continue;
-
                 t = strappend(p, "/uevent");
                 if (!t) {
                         r = -ENOMEM;
@@ -637,7 +642,7 @@ static int attach_device(Manager *m, const char *seat, const char *sysfs) {
         if (r < 0)
                 goto finish;
 
-        r = trigger_device(m, sysfs);
+        r = trigger_device(m, d);
 
 finish:
         free(rule);
index cdb612805f6e4111c00869d59ef51f7d091d2583..1f5f9fe4a6dba927dc55aee3039b60da6c4b855b 100644 (file)
@@ -38,7 +38,6 @@
  * direct client API
  *
  * udev:
- * enumerate recursively with libudev when triggering
  * use sysfs in device hash table, not sysname, when fb driver is fixed
  *
  * non-local X11 server