diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2010-02-02 10:02:53 -0800 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2010-02-02 10:02:53 -0800 |
commit | a9918d59427eae2b00da8fbe92c556a90db38b43 (patch) | |
tree | 3da0ba42a92c4c9c1e940cfad64a941173f300e3 /src | |
parent | 469e54c364de5776b1b41db0f5eaa9cb3f34f6b0 (diff) |
core: ignore VTs
Even just walking sysfs for driver and parent devices takes
time for ports we know we'll never use, so take a short-cut
and save some startup time. This reduces the startup
overhead to some 15%.
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-manager.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mm-manager.c b/src/mm-manager.c index 1a93170b..389acba1 100644 --- a/src/mm-manager.c +++ b/src/mm-manager.c @@ -15,6 +15,7 @@ */ #include <string.h> +#include <ctype.h> #include <gmodule.h> #define G_UDEV_API_IS_SUBJECT_TO_CHANGE #include <gudev/gudev.h> @@ -517,6 +518,10 @@ device_added (MMManager *manager, GUdevDevice *device) subsys = g_udev_device_get_subsystem (device); name = g_udev_device_get_name (device); + /* ignore VTs */ + if (strncmp (name, "tty", 3) == 0 && isdigit (name[3])) + return; + if (find_modem_for_port (manager, subsys, name)) return; |