From e22e1747723cbd9f835f2bdb903f2372f0bdd486 Mon Sep 17 00:00:00 2001 From: Alok Barsode Date: Fri, 24 Feb 2012 16:17:59 +0200 Subject: [PATCH] technology: Enable tech if device is already powered connman_technology_add_device() calls __connman_device_enable() but since the device is already enabled, the calls does not propagate through to __connman_technology_enabled via connman_device_set_powered. --- src/technology.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/technology.c b/src/technology.c index 4a0f9f1..91308a1 100644 --- a/src/technology.c +++ b/src/technology.c @@ -1044,8 +1044,17 @@ int __connman_technology_add_device(struct connman_device *device) return -ENXIO; } - if (technology->enable_persistent && !global_offlinemode) - __connman_device_enable(device); + if (technology->enable_persistent && !global_offlinemode) { + int err = __connman_device_enable(device); + /* + * connman_technology_add_device() calls __connman_device_enable() + * but since the device is already enabled, the calls does not + * propagate through to connman_technology_enabled via + * connman_device_set_powered. + */ + if (err == -EALREADY) + __connman_technology_enabled(type); + } /* if technology persistent state is offline */ if (!technology->enable_persistent) __connman_device_disable(device); -- 2.7.4