From: Alok Barsode Date: Fri, 24 Feb 2012 14:17:59 +0000 (+0200) Subject: technology: Enable tech if device is already powered X-Git-Tag: 0.79~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e22e1747723cbd9f835f2bdb903f2372f0bdd486;p=platform%2Fupstream%2Fconnman.git 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. --- 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);