From: Samuel Ortiz Date: Wed, 8 Sep 2010 14:42:18 +0000 (+0200) Subject: Try to detect portal even if the location driver is already set X-Git-Tag: 0.60~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3f5b873d23cf44fd46d2f132ebf1f6bb4ae71b1e;p=platform%2Fupstream%2Fconnman.git Try to detect portal even if the location driver is already set With DHCP renewals the ConnMan state can go from Online to Ready and a location detect will start. Since the location driver is already set by then, this will fail and ConnMan's state will be stuck at Ready. Instead of returning an error, the location finish() hooks is called and a new portal detection is triggered. --- diff --git a/src/location.c b/src/location.c index aee2ea1..6ea8b3e 100644 --- a/src/location.c +++ b/src/location.c @@ -225,8 +225,15 @@ int __connman_location_detect(struct connman_service *service) if (location == NULL) return -EINVAL; - if (location->driver) - return -EBUSY; + if (location->driver) { + location->result = CONNMAN_LOCATION_RESULT_UNKNOWN; + location->driver->finish(location); + + if (location->driver->detect(location) == 0) + return 0; + + location->driver = NULL; + } for (list = driver_list; list; list = list->next) { struct connman_location_driver *driver = list->data;