]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[bug 2732] Bug 2732 - Leap second not handled correctly on Windows 8
authorJuergen Perlinger <perlinger@ntp.org>
Wed, 28 Jan 2015 21:06:47 +0000 (22:06 +0100)
committerJuergen Perlinger <perlinger@ntp.org>
Wed, 28 Jan 2015 21:06:47 +0000 (22:06 +0100)
 Guard against slewing twice. Something weird is happening under Win8/8.1.

bk: 54c94f67yCUYOiZeBWnhUf9MEyIZHg

ports/winnt/ntpd/nt_clockstuff.c

index e15624cf57f69e55280ef9cdd6aa2f3a75e9a74e..907c9f4ee3e0dc6b89e04ea51fe8b074297e44ec 100644 (file)
@@ -588,9 +588,10 @@ adj_systime(
                if (0 == ls_time_adjustment) { /* has not yet been scheduled */
                        GetSystemTimeAsFileTime(&curr_ft.ft);
                        if (curr_ft.ull >= ls_ft.ull) {
+                               ls_ft.ull = _UI64_MAX; /* guard against second schedule */
                                ls_time_adjustment = clockperiod / LS_CORR_INTV_SECS;
                                ls_start_tick = GetTickCount();
-                               msyslog(LOG_NOTICE, "Inserting positive leap second.");
+                               msyslog(LOG_NOTICE, "Started leap second insertion.");
                        }
                        ls_elapsed = 0;
                } else {  /* leap sec adjustment has been scheduled previously */
@@ -600,7 +601,6 @@ adj_systime(
                if (ls_time_adjustment != 0) {  /* leap second adjustment is currently active */
                        if (ls_elapsed > (LS_CORR_INTV - LS_CORR_LIMIT)) {
                                ls_time_adjustment = 0;  /* leap second adjustment done */
-                               ls_ft.ull = 0;
                                msyslog(LOG_NOTICE, "Finished leap second insertion.");
                        }