summaryrefslogtreecommitdiff
path: root/usr.sbin/ntpd/sensors.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2006-10-12 10:40:46 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2006-10-12 10:40:46 +0000
commit33a02dd2f4b11101536a54eca3baae40a4a649ec (patch)
tree00f2656567d2b5ff4ea95bfc881b697c8c81f25d /usr.sbin/ntpd/sensors.c
parent32a54cebf33b750e05c9f6d306b7ad08492e9114 (diff)
internally, ntpd doesn't work with absolute offsets to system time, but
takes the offset it adjtime() is already correcting for into account when taking the offset from a sensor, we need to correct it by the offset between system time and ntpd view.
Diffstat (limited to 'usr.sbin/ntpd/sensors.c')
-rw-r--r--usr.sbin/ntpd/sensors.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/ntpd/sensors.c b/usr.sbin/ntpd/sensors.c
index ee8a0c31229..4b635afa3ed 100644
--- a/usr.sbin/ntpd/sensors.c
+++ b/usr.sbin/ntpd/sensors.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sensors.c,v 1.21 2006/08/19 16:56:54 henning Exp $ */
+/* $OpenBSD: sensors.c,v 1.22 2006/10/12 10:40:45 henning Exp $ */
/*
* Copyright (c) 2006 Henning Brauer <henning@openbsd.org>
@@ -157,7 +157,8 @@ sensor_query(struct ntp_sensor *s)
return;
memcpy(&refid, "HARD", sizeof(refid));
- s->update.offset = 0 - (float)sensor.value / 1000000000.0;
+ s->update.offset = (0 - (float)sensor.value / 1000000000.0) -
+ getoffset();
s->update.rcvd = sensor.tv.tv_sec;
s->update.good = 1;