diff options
author | Alok Barsode <alok.barsode@linux.intel.com> | 2012-02-03 20:26:01 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-02-04 01:15:36 +0100 |
commit | f97c14e2606c64df0ae23c81a8a4066d27367091 (patch) | |
tree | 733f1bc5f24d4a051193c947f670c8910a9eb72c /src/timeserver.c | |
parent | 8f3c51386929c432af4d78c1e8ab1d82a1f6ac8b (diff) | |
download | connman-f97c14e2606c64df0ae23c81a8a4066d27367091.tar.gz connman-f97c14e2606c64df0ae23c81a8a4066d27367091.tar.bz2 connman-f97c14e2606c64df0ae23c81a8a4066d27367091.zip |
ntp: Add timeserver switch logic
Add a timeout mechanism to switch to next system timeserver
if the current one does not respond or is a bogus one.
Diffstat (limited to 'src/timeserver.c')
-rw-r--r-- | src/timeserver.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/timeserver.c b/src/timeserver.c index 2af173d8..a3614337 100644 --- a/src/timeserver.c +++ b/src/timeserver.c @@ -230,6 +230,8 @@ static void resolv_result(GResolvResultStatus status, char **results, gpointer u DBG("status %d", status); + __sync_fetch_and_add(&count, 1); + if (status == G_RESOLV_RESULT_STATUS_SUCCESS) { if (results != NULL) { for (i = 0; results[i]; i++) @@ -240,7 +242,7 @@ static void resolv_result(GResolvResultStatus status, char **results, gpointer u return; } } - __sync_fetch_and_add(&count, 1); + __connman_timeserver_sync_next(); } |