summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2012-08-16 12:20:45 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-08-17 13:06:29 +0300
commit4d33afaed53d7ca3fcc7522be526a09a5bef3a0a (patch)
tree97c1d760ca3ba8d61e26e95c58cf3f018784f2d2
parentfff6197f1aa998a8a226e808f2b2594491669d4e (diff)
downloadconnman-4d33afaed53d7ca3fcc7522be526a09a5bef3a0a.tar.gz
connman-4d33afaed53d7ca3fcc7522be526a09a5bef3a0a.tar.bz2
connman-4d33afaed53d7ca3fcc7522be526a09a5bef3a0a.zip
service: Clear service error on successfull connection attempts
Move clearing of the error to __connman_service_connect() so it is cleared for all service connect code paths.
-rw-r--r--src/service.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/service.c b/src/service.c
index 8ebf6742..890a3133 100644
--- a/src/service.c
+++ b/src/service.c
@@ -4759,9 +4759,6 @@ static void request_input_cb (struct connman_service *service,
done:
if (err >= 0) {
- /* We forget any previous error. */
- set_error(service, CONNMAN_SERVICE_ERROR_UNKNOWN);
-
__connman_service_connect(service);
/* Never cache agent provided credentials */
@@ -5534,14 +5531,16 @@ int __connman_service_connect(struct connman_service *service)
err = service_connect(service);
}
- if (err >= 0)
+ if (err >= 0) {
+ set_error(service, CONNMAN_SERVICE_ERROR_UNKNOWN);
return 0;
+ }
if (err == -EINPROGRESS) {
if (service->timeout == 0)
service->timeout = g_timeout_add_seconds(
CONNECT_TIMEOUT, connect_timeout, service);
-
+ set_error(service, CONNMAN_SERVICE_ERROR_UNKNOWN);
return -EINPROGRESS;
}