summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/ntpd/refclock_acts.c
diff options
context:
space:
mode:
authorroberto <roberto@FreeBSD.org>2001-08-29 14:35:15 +0000
committerroberto <roberto@FreeBSD.org>2001-08-29 14:35:15 +0000
commit40b8e415eb0f835a9dd7a473ddf134ec67877fd7 (patch)
tree3cfb63f1a112ee17469b17fc1593a88d004ddda6 /contrib/ntp/ntpd/refclock_acts.c
parenta5a8dc6136fcee95f261a31609a25669038c3861 (diff)
downloadFreeBSD-src-40b8e415eb0f835a9dd7a473ddf134ec67877fd7.zip
FreeBSD-src-40b8e415eb0f835a9dd7a473ddf134ec67877fd7.tar.gz
Virgin import of ntpd 4.1.0
Diffstat (limited to 'contrib/ntp/ntpd/refclock_acts.c')
-rw-r--r--contrib/ntp/ntpd/refclock_acts.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/contrib/ntp/ntpd/refclock_acts.c b/contrib/ntp/ntpd/refclock_acts.c
index 9c367b5..efdf536 100644
--- a/contrib/ntp/ntpd/refclock_acts.c
+++ b/contrib/ntp/ntpd/refclock_acts.c
@@ -9,13 +9,6 @@
#if defined(REFCLOCK) && (defined(CLOCK_ACTS) || defined(CLOCK_PTBACTS))
-#include <stdio.h>
-#include <ctype.h>
-#include <sys/time.h>
-#ifdef HAVE_SYS_IOCTL_H
-# include <sys/ioctl.h>
-#endif /* HAVE_SYS_IOCTL_H */
-
#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_unixtime.h"
@@ -23,6 +16,12 @@
#include "ntp_stdlib.h"
#include "ntp_control.h"
+#include <stdio.h>
+#include <ctype.h>
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif /* HAVE_SYS_IOCTL_H */
+
/* MUST BE AFTER LAST #include <config.h> !!! */
#if defined(CLOCK_ACTS) && defined(CLOCK_PTBACTS)
@@ -655,19 +654,22 @@ acts_receive (
(void)write(pp->io.fd, &flag, 1);
/*
- * Yes, I know this code incorrectly thinks that 2000 is a leap
- * year. The ACTS timecode format croaks then anyway. Life is
- * short. Would only the timecode mavens resist the urge to
- * express months of the year and days of the month in favor of
- * days of the year.
- * NOTE: year 2000 IS a leap year!!! ghealton Y2KFixes
+ * The ACTS timecode format croaks in 2000. Life is short.
+ * Would only the timecode mavens resist the urge to express months
+ * of the year and days of the month in favor of days of the year.
*/
if (month < 1 || month > 12 || day < 1) {
refclock_report(peer, CEVNT_BADTIME);
return;
}
- if ( pp->year <= YEAR_PIVOT ) pp->year += 100; /* Y2KFixes */
- if ( !isleap_tm(pp->year) ) { /* Y2KFixes */
+
+ /*
+ * Depending on the driver, at this point we have a two-digit year
+ * or a four-digit year. Make sure we have a four-digit year.
+ */
+ if ( pp->year < YEAR_PIVOT ) pp->year += 100; /* Y2KFixes */
+ if ( pp->year < YEAR_BREAK ) pp->year += 1900; /* Y2KFixes */
+ if ( !isleap_4(pp->year) ) { /* Y2KFixes */
if (day > day1tab[month - 1]) {
refclock_report(peer, CEVNT_BADTIME);
return;
@@ -798,7 +800,7 @@ acts_timeout (
acts_disc(peer);
return;
}
- switch (peer->ttl) {
+ switch (peer->ttlmax) {
/*
* In manual mode the ACTS calling program is activated
OpenPOWER on IntegriCloud