summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/ntpd/refclock_tpro.c
diff options
context:
space:
mode:
authorroberto <roberto@FreeBSD.org>2004-07-20 15:01:56 +0000
committerroberto <roberto@FreeBSD.org>2004-07-20 15:01:56 +0000
commit118e757284cbb8fc4f43a713e892b41504b50a5f (patch)
tree528d12dda44ebdc3ffcc38050f159ac553a69c17 /contrib/ntp/ntpd/refclock_tpro.c
parenta85d9ae25e8e8696677bc30feb6eaf7fc150e529 (diff)
downloadFreeBSD-src-118e757284cbb8fc4f43a713e892b41504b50a5f.zip
FreeBSD-src-118e757284cbb8fc4f43a713e892b41504b50a5f.tar.gz
Virgin import of ntpd 4.2.0
Diffstat (limited to 'contrib/ntp/ntpd/refclock_tpro.c')
-rw-r--r--contrib/ntp/ntpd/refclock_tpro.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/contrib/ntp/ntpd/refclock_tpro.c b/contrib/ntp/ntpd/refclock_tpro.c
index 159f817..3c42568 100644
--- a/contrib/ntp/ntpd/refclock_tpro.c
+++ b/contrib/ntp/ntpd/refclock_tpro.c
@@ -164,6 +164,11 @@ tpro_poll(
* can't use the sec/usec conversion produced by the driver,
* since the year may be suspect. All format error checking is
* done by the sprintf() and sscanf() routines.
+ *
+ * Note that the refclockproc usec member has now become nsec.
+ * We could either multiply the read-in usec value by 1000 or
+ * we could pad the written string appropriately and read the
+ * resulting value in already scaled.
*/
sprintf(pp->a_lastcode,
"%1x%1x%1x %1x%1x:%1x%1x:%1x%1x.%1x%1x%1x%1x%1x%1x %1x",
@@ -179,11 +184,12 @@ tpro_poll(
pp->a_lastcode);
#endif
if (sscanf(pp->a_lastcode, "%3d %2d:%2d:%2d.%6ld", &pp->day,
- &pp->hour, &pp->minute, &pp->second, &pp->usec)
+ &pp->hour, &pp->minute, &pp->second, &pp->nsec)
!= 5) {
refclock_report(peer, CEVNT_BADTIME);
return;
}
+ pp->nsec *= 1000; /* Convert usec to nsec */
if (!tp->status & 0x3)
pp->leap = LEAP_NOTINSYNC;
else
@@ -198,6 +204,8 @@ tpro_poll(
refclock_report(peer, CEVNT_TIMEOUT);
return;
}
+ refclock_receive(peer);
+ pp->lastref = pp->lastrec;
record_clock_stats(&peer->srcadr, pp->a_lastcode);
refclock_receive(peer);
peer->burst = NSTAGE;
OpenPOWER on IntegriCloud