diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2006-11-20 20:58:48 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2006-11-20 20:58:48 +0000 |
commit | 1b0541f3831e7822e326008181c1585dc42fc148 (patch) | |
tree | 54f8cee9894424e669e461ef82d80e5bfd23fdd7 | |
parent | 0d8f094175a94b4fa0fdf8e3276e80aa17a81c7c (diff) |
with usig the meadian offset froma number of measurements the recording
of the last sensor update time got broken, doesn't show up with gps since
it updates often (more often than we read), but naddy ran into it with dcf.
record time of last sensor datum seperately. ok naddy balmer
-rw-r--r-- | usr.sbin/ntpd/ntpd.h | 3 | ||||
-rw-r--r-- | usr.sbin/ntpd/sensors.c | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/ntpd/ntpd.h b/usr.sbin/ntpd/ntpd.h index ca5262cfe99..6ceea199a58 100644 --- a/usr.sbin/ntpd/ntpd.h +++ b/usr.sbin/ntpd/ntpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ntpd.h,v 1.78 2006/10/27 12:22:41 henning Exp $ */ +/* $OpenBSD: ntpd.h,v 1.79 2006/11/20 20:58:47 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -138,6 +138,7 @@ struct ntp_sensor { struct ntp_offset offsets[SENSOR_OFFSETS]; struct ntp_offset update; time_t next; + time_t last; char *device; int sensorid; u_int8_t weight; diff --git a/usr.sbin/ntpd/sensors.c b/usr.sbin/ntpd/sensors.c index 41b6dd51bad..612b695e8be 100644 --- a/usr.sbin/ntpd/sensors.c +++ b/usr.sbin/ntpd/sensors.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sensors.c,v 1.25 2006/10/27 12:22:41 henning Exp $ */ +/* $OpenBSD: sensors.c,v 1.26 2006/11/20 20:58:47 henning Exp $ */ /* * Copyright (c) 2006 Henning Brauer <henning@openbsd.org> @@ -156,9 +156,10 @@ sensor_query(struct ntp_sensor *s) return; } - if (sensor.tv.tv_sec == s->update.rcvd) /* already seen */ + if (sensor.tv.tv_sec == s->last) /* already seen */ return; + s->last = sensor.tv.tv_sec; memcpy(&refid, "HARD", sizeof(refid)); s->offsets[s->shift].offset = (0 - (float)sensor.value / 1000000000.0) - getoffset(); |