diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-07-13 21:49:21 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-07-13 21:49:21 +0200 |
commit | 2eb916cdff570a2ce741fc9b40d7316a77c57c27 (patch) | |
tree | f7f083a324bc477524bce263042db7f8ce92a2f2 /src/logind-dbus.c | |
parent | 309c2a2ce95aae54879b4957d113f03608530c15 (diff) |
logind: use new udev_enumerate_add_match_parent() where applicable
Diffstat (limited to 'src/logind-dbus.c')
-rw-r--r-- | src/logind-dbus.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/logind-dbus.c b/src/logind-dbus.c index e0855f4cf8..4321ffd900 100644 --- a/src/logind-dbus.c +++ b/src/logind-dbus.c @@ -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); |