summaryrefslogtreecommitdiff
path: root/src/login/logind.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/login/logind.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/login/logind.c')
-rw-r--r--src/login/logind.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/login/logind.c b/src/login/logind.c
index b97ba6df3e..48da7b173b 100644
--- a/src/login/logind.c
+++ b/src/login/logind.c
@@ -198,6 +198,10 @@ static int manager_enumerate_devices(Manager *m) {
if (r < 0)
return r;
+ r = udev_enumerate_add_match_is_initialized(e);
+ if (r < 0)
+ return r;
+
r = udev_enumerate_scan_devices(e);
if (r < 0)
return r;
@@ -211,9 +215,6 @@ static int manager_enumerate_devices(Manager *m) {
if (!d)
return -ENOMEM;
- if (!udev_device_get_is_initialized(d))
- continue;
-
k = manager_process_seat_device(m, d);
if (k < 0)
r = k;
@@ -249,6 +250,10 @@ static int manager_enumerate_buttons(Manager *m) {
if (r < 0)
return r;
+ r = udev_enumerate_add_match_is_initialized(e);
+ if (r < 0)
+ return r;
+
r = udev_enumerate_scan_devices(e);
if (r < 0)
return r;
@@ -262,9 +267,6 @@ static int manager_enumerate_buttons(Manager *m) {
if (!d)
return -ENOMEM;
- if (!udev_device_get_is_initialized(d))
- continue;
-
k = manager_process_button_device(m, d);
if (k < 0)
r = k;