diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-05-22 01:00:28 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-05-22 01:00:28 +0200 |
commit | e1ce2c2782015579f042d4d6963ed039333fb8c2 (patch) | |
tree | be4d1647cce5d64f6fde549d3543435b118d7016 /src/device.c | |
parent | 11c3a4eeb7e65eccd6fc0870bb1cda315fa33ba5 (diff) |
device: make use of new libudev tags logic
Diffstat (limited to 'src/device.c')
-rw-r--r-- | src/device.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/device.c b/src/device.c index e67d0a6c2d..adc6cc1e27 100644 --- a/src/device.c +++ b/src/device.c @@ -144,31 +144,19 @@ static int device_find_escape_name(Manager *m, const char *dn, Unit **_u) { } static int device_process_new_device(Manager *m, struct udev_device *dev, bool update_state) { - const char *dn, *wants, *sysfs, *expose, *model, *alias; + const char *dn, *wants, *sysfs, *model, *alias; Unit *u = NULL; int r; char *w, *state; size_t l; bool delete; struct udev_list_entry *item = NULL, *first = NULL; - int b; assert(m); if (!(sysfs = udev_device_get_syspath(dev))) return -ENOMEM; - if (!(expose = udev_device_get_property_value(dev, "SYSTEMD_EXPOSE"))) - return 0; - - if ((b = parse_boolean(expose)) < 0) { - log_error("Failed to parse SYSTEMD_EXPOSE udev property for device %s: %s", sysfs, expose); - return 0; - } - - if (!b) - return 0; - /* Check whether this entry is even relevant for us. */ dn = udev_device_get_devnode(dev); wants = udev_device_get_property_value(dev, "SYSTEMD_WANTS"); @@ -365,6 +353,11 @@ static int device_enumerate(Manager *m) { goto fail; } + if (udev_monitor_filter_add_match_tag(m->udev_monitor, "systemd") < 0) { + r = -ENOMEM; + goto fail; + } + if (udev_monitor_enable_receiving(m->udev_monitor) < 0) { r = -EIO; goto fail; @@ -385,6 +378,10 @@ static int device_enumerate(Manager *m) { r = -ENOMEM; goto fail; } + if (udev_enumerate_add_match_tag(e, "systemd") < 0) { + r = -EIO; + goto fail; + } if (udev_enumerate_scan_devices(e) < 0) { r = -EIO; |