From: Tomasz Bursztyka Date: Fri, 8 Jul 2011 16:31:03 +0000 (+0300) Subject: service: preventing to call ready state more than once. X-Git-Tag: 2.0_alpha~1330 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d5fcad5c684b81db393899ab5f0927299d4fb3ec;p=framework%2Fconnectivity%2Fconnman.git service: preventing to call ready state more than once. --- diff --git a/src/service.c b/src/service.c index 04bc51c..495e4de 100644 --- a/src/service.c +++ b/src/service.c @@ -363,7 +363,8 @@ static enum connman_service_state combine_state( } if (state_a == CONNMAN_SERVICE_STATE_READY) { - if (state_b == CONNMAN_SERVICE_STATE_ONLINE) + if (state_b == CONNMAN_SERVICE_STATE_ONLINE || + state_b == CONNMAN_SERVICE_STATE_DISCONNECT) result = state_b; else result = state_a; @@ -371,7 +372,8 @@ static enum connman_service_state combine_state( } if (state_b == CONNMAN_SERVICE_STATE_READY) { - if (state_a == CONNMAN_SERVICE_STATE_ONLINE) + if (state_a == CONNMAN_SERVICE_STATE_ONLINE || + state_a == CONNMAN_SERVICE_STATE_DISCONNECT) result = state_a; else result = state_b; @@ -389,12 +391,12 @@ static enum connman_service_state combine_state( } if (state_a == CONNMAN_SERVICE_STATE_DISCONNECT) { - result = state_b; + result = state_a; goto done; } if (state_b == CONNMAN_SERVICE_STATE_DISCONNECT) { - result = state_a; + result = state_b; goto done; }