service: Do not stay on failure state when it is due to wrong user input
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Thu, 3 May 2012 09:55:19 +0000 (12:55 +0300)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Fri, 4 May 2012 08:29:09 +0000 (11:29 +0300)
src/service.c

index 3a046ea..75c392e 100644 (file)
@@ -4339,6 +4339,10 @@ static void report_error_cb(struct connman_service *service,
        if (retry == TRUE)
                __connman_service_connect(service);
        else {
+               /* It is not relevant to stay on Failure state
+                * when failing is due to wrong user input */
+               service->state = CONNMAN_SERVICE_STATE_IDLE;
+
                service_complete(service);
                __connman_connection_update_gateway();
        }
@@ -4464,7 +4468,11 @@ static void request_input_cb (struct connman_service *service,
                __connman_agent_report_error(service,
                                        error2string(service->error),
                                        report_error_cb, NULL);
-       } else if (err == -EINVAL) {
+       } else {
+               /* It is not relevant to stay on Failure state
+                * when failing is due to wrong user input */
+               service->state = CONNMAN_SERVICE_STATE_IDLE;
+
                service_complete(service);
                __connman_connection_update_gateway();
        }