]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
sources: ignore inactive sources in special mode ending
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 10 Apr 2014 15:11:20 +0000 (17:11 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 10 Apr 2014 15:50:24 +0000 (17:50 +0200)
main.c
sources.c

diff --git a/main.c b/main.c
index e8daf33d4addac38f20f298e0815cdd61dc83b8a..dec753de6c70f9d5e11d48735af40909fd4f2bd7 100644 (file)
--- a/main.c
+++ b/main.c
@@ -150,8 +150,8 @@ post_init_ntp_hook(void *anything)
   RCL_StartRefclocks();
 
   /* Special modes can end only when sources update their reachability.
-     Give up immediatelly if there are no sources. */
-  if (ref_mode != REF_ModeNormal && !SRC_ReadNumberOfSources()) {
+     Give up immediatelly if there are no active sources. */
+  if (ref_mode != REF_ModeNormal && !SRC_ActiveSources()) {
     REF_SetUnsynchronised();
   }
 }
index 8ba1190a4c9b0066a5eb6f180a18dea23fa8cc90..8eae88b8d7b726b2a0eefc0b17886dc7954a785a 100644 (file)
--- a/sources.c
+++ b/sources.c
@@ -373,6 +373,10 @@ special_mode_end(void)
     int i;
 
     for (i = 0; i < n_sources; i++) {
+      /* No updates from inactive sources */
+      if (!sources[i]->active)
+        continue;
+
       /* Don't expect more updates than from an offline iburst NTP source */
       if (sources[i]->reachability_size >= SOURCE_REACH_BITS - 1)
         continue;