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;
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;
p = udev_list_entry_get_name(item);
- if (prefix && !path_startswith(p, prefix))
- continue;
-
t = strappend(p, "/uevent");
if (!t) {
r = -ENOMEM;
if (r < 0)
goto finish;
- r = trigger_device(m, sysfs);
+ r = trigger_device(m, d);
finish:
free(rule);
* 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