summaryrefslogtreecommitdiff
path: root/src/core/device.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-12-18 17:12:15 +0100
committerLennart Poettering <lennart@poettering.net>2013-12-18 18:21:28 +0100
commite120204729764f6243b60899eb907103e678bee2 (patch)
tree6513453989189dec5bdc57a2e0a28a2bfee2012a /src/core/device.c
parentfa28bc2df724e4aff46d19cb7aa732cc64c71061 (diff)
core,logind,networkd: check for udev device initialization via enumeration matches
Instead of checking each device after we got it, check wuth an enumeration filter instead, to make it more efficient.
Diffstat (limited to 'src/core/device.c')
-rw-r--r--src/core/device.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/core/device.c b/src/core/device.c
index c93c94726d..72d98aea72 100644
--- a/src/core/device.c
+++ b/src/core/device.c
@@ -303,14 +303,6 @@ static int device_process_new_device(Manager *m, struct udev_device *dev) {
assert(m);
-#if 0
- /* FIXME: this is always false for devices received from udev_monitor */
-
- /* Don't pick up devices before udev finished initialization for them */
- if (!udev_device_get_is_initialized(dev))
- return 0;
-#endif
-
sysfs = udev_device_get_syspath(dev);
if (!sysfs)
return 0;
@@ -557,6 +549,10 @@ static int device_enumerate(Manager *m) {
if (r < 0)
goto fail;
+ r = udev_enumerate_add_match_is_initialized(e);
+ if (r < 0)
+ goto fail;
+
r = udev_enumerate_scan_devices(e);
if (r < 0)
goto fail;