} else {
memset(&limit, 0, sizeof(limit));
}
-
+
while (get_line(func, farg, linebuf, sizeof(linebuf))) {
cp = linebuf;
if (*cp == '#') {
pt->head.update = strtouv64(cp, &ep, 10);
if (parsefail(cp, ep))
goto fail_read;
- }
+ }
} else if (isdigit((u_char)*cp)) {
ttime = strtouv64(cp, &ep, 10);
if (parsefail(cp, ep))
/* if not in the last day before transition, we're done. */
if (!betweenu32(due32 - SECSPERDAY, ts32, due32))
return fired;
-
+
qr->proximity = LSPROX_ANNOUNCE;
if (!betweenu32(due32 - 10, ts32, due32))
return fired;
{
const leap_table_t * pt;
vint64 ts64;
-
+
pt = leapsec_get_table(FALSE);
ts64 = ntpcal_ntp_to_ntp(ntpts, pivot);
fetch_leap_era(qr, pt, &ts64);
msyslog(LOG_NOTICE, "%s ('%s'): good hash signature",
logPrefix, fname);
break;
-
+
case LSVALID_NOHASH:
msyslog(LOG_ERR, "%s ('%s'): no hash signature",
logPrefix, fname);
"%s ('%s'): loaded, expire=%s ofs=%d (no entries after build date)",
logPrefix, fname, lstostr(&pt->head.expire),
pt->head.base_tai);
-
+
return leapsec_set_table(pt);
}
/* just do nothing if there is no leap file */
if ( !(fname && *fname) )
return FALSE;
-
+
/* try to stat the leapfile */
if (0 != stat(fname, &sb_new)) {
if (logall)
time(&tpiv);
pivot = &tpiv;
}
-
+
et64 = ntpcal_ntp_to_ntp(etime, pivot);
tt64 = ntpcal_ntp_to_ntp(ttime, pivot);
pt = leapsec_get_table(TRUE);
leap_era_t era;
vint64 now64;
int idx;
-
+
(void)tai_offset;
pt = leapsec_get_table(FALSE);
-
+
/* Bail out if the basic offset is not zero and the putative
* offset is bigger than 10s. That was in 1972 -- we don't want
* to go back that far!
* side the transition the sender might have been, so we use a
* dead zone around the transition.
*/
-
+
/* Check for static entries */
for (idx = 0; idx != pt->head.size; idx++)
if ( ! pt->info[idx].dynls)
/* get the fulll time stamp and leap era for it */
now64 = ntpcal_ntp_to_ntp(ntpnow, pivot);
fetch_leap_era(&era, pt, &now64);
-
+
/* check the limits with 20s dead band */
era.ebase = addv64i32(&era.ebase, 20);
if (ucmpv64(&now64, &era.ebase) < 0)
era.ttime = addv64i32(&era.ttime, -20);
if (ucmpv64(&now64, &era.ttime) > 0)
return FALSE;
-
+
/* Here we can proceed. Calculate the delta update. */
tai_offset -= era.taiof;
}
/* make room in lower end and insert item */
- memmove(pt->info+1, pt->info, pt->head.size*sizeof(*pt->info));
+ memmove(pt->info+1, pt->info, pt->head.size*sizeof(*pt->info));
pt->info[0] = *pi;
pt->head.size++;
{
int ch;
char *ptr;
-
+
/* if we cannot even store the delimiter, declare failure */
if (buff == NULL || size == 0)
return NULL;
pt->head.dtime = addv64i32(
&pt->head.ttime,
pt->head.next_tai - pt->head.this_tai);
-
+
pt->head.stime = subv64u32(
&pt->head.ttime, pt->info[idx].stime);
isc_sha1_update(
mdctx, text, sizeof(text));
}
-
+
if (0 < tlen)
isc_sha1_update(mdctx, text, tlen);
}
static timer_t timer_id;
typedef struct itimerspec intervaltimer;
# define itv_frac tv_nsec
-# else
+# else
typedef struct itimerval intervaltimer;
# define itv_frac tv_usec
# endif
/*
* reinit_timer - reinitialize interval timer after a clock step.
*/
-void
+void
reinit_timer(void)
{
#if !defined(SYS_WINNT) && !defined(VMS)
}
# endif
signal_no_reset(SIGALRM, alarming);
- itimer.it_interval.tv_sec =
+ itimer.it_interval.tv_sec =
itimer.it_value.tv_sec = (1 << EVENT_TIMEOUT);
itimer.it_interval.itv_frac = itimer.it_value.itv_frac = 0;
set_timer_or_die(&itimer);
#else /* SYS_WINNT follows */
/*
* Set up timer interrupts for every 2**EVENT_TIMEOUT seconds
- * Under Windows/NT,
+ * Under Windows/NT,
*/
WaitableTimerHandle = CreateWaitableTimer(NULL, FALSE, NULL);
if (sys_leap == LEAP_NOTINSYNC) {
sys_leap = LEAP_NOWARNING;
#ifdef AUTOKEY
- if (crypto_flags)
+ if (crypto_flags)
crypto_update();
#endif /* AUTOKEY */
}
#ifdef AUTOKEY
int/*BOOL*/ update_autokey;
#endif
-
+
#ifndef SYS_WINNT /* WinNT port has its own leap second handling */
# ifdef KERNEL_PLL
leapsec_electric(pll_control && kern_enable);