]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
main: delay switching to normal mode after initstepslew
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 3 Jun 2014 15:55:35 +0000 (17:55 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 3 Jun 2014 16:10:27 +0000 (18:10 +0200)
This prevents polling interval shorter than the burst interval
if some configured servers were used also for initstepslew.

main.c

diff --git a/main.c b/main.c
index 79ce2dece93afc1751299bb2d98ecf61ca0702b6..f56402f8a6411ca8b446751cce5374454c56192b 100644 (file)
--- a/main.c
+++ b/main.c
@@ -182,9 +182,10 @@ reference_mode_end(int result)
       SCH_QuitProgram();
       break;
     case REF_ModeInitStepSlew:
-      /* post_init_ntp_hook removes sources and a source call is
-         on the stack here, so it can't be called directly */
-      SCH_AddTimeoutByDelay(0.0, post_init_ntp_hook, NULL);
+      /* Switch to the normal mode, the delay is used to prevent polling
+         interval shorter than the burst interval if some configured servers
+         were used also for initstepslew */
+      SCH_AddTimeoutByDelay(2.0, post_init_ntp_hook, NULL);
       break;
     default:
       assert(0);