Browse Source

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.
OPENBSD_4_1
henning 17 years ago
parent
commit
988040972e
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      src/usr.sbin/ntpd/sensors.c

+ 3
- 2
src/usr.sbin/ntpd/sensors.c View File

@ -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;


Loading…
Cancel
Save