summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-07-18 21:17:49 +0200
committerPeter Hutterer <peter.hutterer@who-t.net>2011-07-27 09:29:49 +1000
commitf13de9ca1b7c4dd0dd5c08037c6bd53f88ac30f5 (patch)
tree0fe3fd35108a972886ee7ed127d0490822a7a4ad
parent882e3c2680c339ad7aa0d664e0b0f02b8a05b11d (diff)
config: limit the kernel subsystems we look for devices in
Don't enumerate/monitor all devices of the system (since that can be quite a few), but limit our search to devices from the "input" subsystem, as well as the "tty" subsystem (to cover Wacom tablets). This should make X start up a bit faster and reduce the number of unnecessary wake-ups of the X server. Signed-off-by: Lennart Poettering <lennart@poettering.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--config/udev.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/config/udev.c b/config/udev.c
index 5ac52a1d7..0763cc9a0 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -281,6 +281,9 @@ config_udev_init(void)
if (!udev_monitor)
return 0;
+ udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "input", NULL);
+ udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "tty", NULL); /* For Wacom serial devices */
+
if (udev_monitor_enable_receiving(udev_monitor)) {
ErrorF("config/udev: failed to bind the udev monitor\n");
return 0;
@@ -289,6 +292,10 @@ config_udev_init(void)
enumerate = udev_enumerate_new(udev);
if (!enumerate)
return 0;
+
+ udev_enumerate_add_match_subsystem(enumerate, "input");
+ udev_enumerate_add_match_subsystem(enumerate, "tty");
+
udev_enumerate_scan_devices(enumerate);
devices = udev_enumerate_get_list_entry(enumerate);
udev_list_entry_foreach(device, devices) {