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%.
This commit is contained in:

committed by
Dan Williams

parent
469e54c364
commit
a9918d5942
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user