summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-07-03 15:11:10 -0700
committerMarcel Holtmann <marcel@holtmann.org>2009-07-03 15:11:10 -0700
commit1c3c447691960239fd9362e9d63ee8f5004c00f3 (patch)
tree35333afba4d08ef733502b92e70566320d185b88
parentf2419468e93e2dba548d02a511993a8443f9d1eb (diff)
downloadconnman-1c3c447691960239fd9362e9d63ee8f5004c00f3.tar.gz
connman-1c3c447691960239fd9362e9d63ee8f5004c00f3.tar.bz2
connman-1c3c447691960239fd9362e9d63ee8f5004c00f3.zip
Also check for TTY devices
-rw-r--r--src/udev.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/udev.c b/src/udev.c
index 71f594f9..f8cea7f0 100644
--- a/src/udev.c
+++ b/src/udev.c
@@ -183,7 +183,7 @@ static void print_properties(struct udev_device *device, const char *prefix)
static void print_device(struct udev_device *device, const char *action)
{
- const char *subsystem, *sysname, *devtype = NULL;
+ const char *subsystem, *sysname, *driver, *devtype = NULL;
struct udev_device *parent;
connman_debug("=== %s ===", action);
@@ -205,10 +205,20 @@ static void print_device(struct udev_device *device, const char *action)
subsystem, devtype);
print_properties(parent, " ");
+ driver = udev_device_get_driver(device);
+ if (driver == NULL) {
+ driver = udev_device_get_driver(parent);
+ if (driver == NULL)
+ return;
+ }
+
devtype = udev_device_get_devtype(device);
sysname = udev_device_get_sysname(device);
- connman_info("%s ==> %s (%s)", sysname, devtype, action);
+ driver = udev_device_get_driver(parent);
+
+ connman_info("%s ==> %s [%s] (%s)", sysname, devtype,
+ driver, action);
}
static void enumerate_devices(struct udev *context)
@@ -221,6 +231,7 @@ static void enumerate_devices(struct udev *context)
return;
udev_enumerate_add_match_subsystem(enumerate, "net");
+ udev_enumerate_add_match_subsystem(enumerate, "tty");
udev_enumerate_scan_devices(enumerate);
@@ -258,7 +269,8 @@ static gboolean udev_event(GIOChannel *channel,
if (subsystem == NULL)
goto done;
- if (g_str_equal(subsystem, "net") == FALSE)
+ if (g_str_equal(subsystem, "net") == FALSE &&
+ g_str_equal(subsystem, "tty") == FALSE)
goto done;
action = udev_device_get_action(device);