From: Juergen Perlinger Date: Wed, 28 Jan 2015 21:06:47 +0000 (+0100) Subject: [bug 2732] Bug 2732 - Leap second not handled correctly on Windows 8 X-Git-Tag: NTP_4_2_8P1_RC2~1^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2385b70b2a1b05d4503a840e0e393db0304fc342;p=thirdparty%2Fntp.git [bug 2732] Bug 2732 - Leap second not handled correctly on Windows 8 Guard against slewing twice. Something weird is happening under Win8/8.1. bk: 54c94f67yCUYOiZeBWnhUf9MEyIZHg --- diff --git a/ports/winnt/ntpd/nt_clockstuff.c b/ports/winnt/ntpd/nt_clockstuff.c index e15624cf5..907c9f4ee 100644 --- a/ports/winnt/ntpd/nt_clockstuff.c +++ b/ports/winnt/ntpd/nt_clockstuff.c @@ -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."); }