From 21eefd4611ff25fe99a3fdb8c2502978a780c948 Mon Sep 17 00:00:00 2001 From: Tomasz Bursztyka Date: Fri, 8 Jul 2011 20:04:37 +0300 Subject: [PATCH] service: disconnect state has priority over online one. --- src/service.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/service.c b/src/service.c index 495e4de..bfd94a5 100644 --- a/src/service.c +++ b/src/service.c @@ -381,12 +381,18 @@ static enum connman_service_state combine_state( } if (state_a == CONNMAN_SERVICE_STATE_ONLINE) { - result = state_a; + if (state_b == CONNMAN_SERVICE_STATE_DISCONNECT) + result = state_b; + else + result = state_a; goto done; } if (state_b == CONNMAN_SERVICE_STATE_ONLINE) { - result = state_b; + if (state_a == CONNMAN_SERVICE_STATE_DISCONNECT) + result = state_a; + else + result = state_b; goto done; } -- 2.7.4