]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Prepare for handling offset correction error
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 10 Feb 2010 14:59:40 +0000 (15:59 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 16 Feb 2010 16:46:42 +0000 (17:46 +0100)
19 files changed:
acquire.c
broadcast.c
cmdmon.c
local.c
local.h
localp.h
manual.c
ntp_core.c
ntp_io.c
refclock.c
reference.c
rtc_linux.c
sched.c
sched.h
sources.c
sys_linux.c
sys_netbsd.c
sys_solaris.c
sys_sunos.c

index 3f702b6e7af25f55f67bf239d31baee4ced728b7..ad2047d8f09687fc8a8df29263801011b1cf53d9 100644 (file)
--- a/acquire.c
+++ b/acquire.c
@@ -248,7 +248,6 @@ probe_source(SourceRecord *src)
   int version = 3;
   NTP_Mode my_mode = MODE_CLIENT;
   struct timeval cooked;
-  double local_time_err;
   union sockaddr_in46 his_addr;
   int sock_fd;
   socklen_t addrlen;
@@ -300,7 +299,7 @@ probe_source(SourceRecord *src)
   }
 
 
-  LCL_ReadCookedTime(&cooked, &local_time_err);
+  LCL_ReadCookedTime(&cooked, NULL);
   UTI_TimevalToInt64(&cooked, &pkt.transmit_ts);
 
   if (sendto(sock_fd, (void *) &pkt, NTP_NORMAL_PACKET_SIZE,
@@ -449,7 +448,7 @@ read_from_socket(void *anything)
   his_addr_len = sizeof(his_addr);
 
   /* Get timestamp */
-  SCH_GetFileReadyTime(&now);
+  SCH_GetFileReadyTime(&now, NULL);
 
   sock_fd = (long)anything;
   status = recvfrom (sock_fd, (char *)&msg, message_length, flags,
index 6cd0a48feeb79c9f2298e4eef54174ed3b5d65da..4005ba621092e64121cf0f9fe870ffb689df50ec 100644 (file)
@@ -78,12 +78,11 @@ timeout_handler(void *arbitrary)
   unsigned long our_ref_id;
   struct timeval our_ref_time;
   double our_root_delay, our_root_dispersion;
-  double local_time_err;
   struct timeval local_transmit;
 
   version = 3;
 
-  LCL_ReadCookedTime(&local_transmit, &local_time_err);
+  LCL_ReadCookedTime(&local_transmit, NULL);
   REF_GetReferenceParams(&local_transmit,
                          &are_we_synchronised, &leap_status,
                          &our_stratum,
@@ -116,7 +115,7 @@ timeout_handler(void *arbitrary)
   message.receive_ts.hi = 0UL;
   message.receive_ts.lo = 0UL;
 
-  LCL_ReadCookedTime(&local_transmit, &local_time_err);
+  LCL_ReadCookedTime(&local_transmit, NULL);
   UTI_TimevalToInt64(&local_transmit, &message.transmit_ts);
   NIO_SendNormalPacket(&message, &d->addr);
 
index 2ccc5448003a0769883e5af804cca0677f9bce60..05ebfc565221aa0f70bc815d1e2bc14d430cb9b5 100644 (file)
--- a/cmdmon.c
+++ b/cmdmon.c
@@ -991,10 +991,9 @@ handle_source_data(CMD_Request *rx_message, CMD_Reply *tx_message)
 {
   RPT_SourceReport report;
   struct timeval now_corr;
-  double local_clock_err;
 
   /* Get data */
-  LCL_ReadCookedTime(&now_corr, &local_clock_err);
+  LCL_ReadCookedTime(&now_corr, NULL);
   if (SRC_ReportSource(ntohl(rx_message->data.source_data.index), &report, &now_corr)) {
     switch (SRC_GetType(ntohl(rx_message->data.source_data.index))) {
       case SRC_NTP:
@@ -1394,9 +1393,8 @@ handle_sourcestats(CMD_Request *rx_message, CMD_Reply *tx_message)
   int status;
   RPT_SourcestatsReport report;
   struct timeval now_corr;
-  double local_clock_err;
 
-  LCL_ReadCookedTime(&now_corr, &local_clock_err);
+  LCL_ReadCookedTime(&now_corr, NULL);
   status = SRC_ReportSourcestats(ntohl(rx_message->data.sourcestats.index),
                                  &report, &now_corr);
 
@@ -1531,9 +1529,8 @@ handle_client_accesses(CMD_Request *rx_message, CMD_Reply *tx_message)
   IPAddr ip;
   int i;
   struct timeval now;
-  double local_time_error;
 
-  LCL_ReadCookedTime(&now, &local_time_error);
+  LCL_ReadCookedTime(&now, NULL);
 
   nc = ntohl(rx_message->data.client_accesses.n_clients);
   tx_message->status = htons(STT_SUCCESS);
@@ -1585,9 +1582,8 @@ handle_client_accesses_by_index(CMD_Request *rx_message, CMD_Reply *tx_message)
   unsigned long first_index, n_indices, last_index, n_indices_in_table;
   int i, j;
   struct timeval now;
-  double local_time_error;
 
-  LCL_ReadCookedTime(&now, &local_time_error);
+  LCL_ReadCookedTime(&now, NULL);
 
   first_index = ntohl(rx_message->data.client_accesses_by_index.first_index);
   n_indices = ntohl(rx_message->data.client_accesses_by_index.n_indices);
@@ -1742,7 +1738,6 @@ read_from_cmd_socket(void *anything)
   unsigned long rx_attempt;
   struct timeval now;
   struct timeval cooked_now;
-  double local_clock_err;
 
   flags = 0;
   rx_message_length = sizeof(rx_message);
@@ -1762,7 +1757,7 @@ read_from_cmd_socket(void *anything)
   expected_length = PKL_CommandLength(&rx_message);
 
   LCL_ReadRawTime(&now);
-  LCL_ReadCookedTime(&cooked_now, &local_clock_err);
+  LCL_CookTime(&now, &cooked_now, NULL);
 
   tx_message.version = PROTO_VERSION_NUMBER;
   tx_message.pkt_type = PKT_TYPE_CMD_REPLY;
diff --git a/local.c b/local.c
index 5d832c313c8e0579dfb044c4e247a075957ed85c..1be61174cceb5a77712519e3689d70ab24ecab1f 100644 (file)
--- a/local.c
+++ b/local.c
@@ -316,8 +316,6 @@ LCL_ReadRawTime(struct timeval *result)
   if (!(gettimeofday(result, &tz) >= 0)) {
     CROAK("Could not get time of day");
   }
-  return;
-
 }
 
 /* ================================================== */
@@ -326,30 +324,34 @@ void
 LCL_ReadCookedTime(struct timeval *result, double *err)
 {
   struct timeval raw;
-  double correction;
 
   LCL_ReadRawTime(&raw);
+  LCL_CookTime(&raw, result, err);
+}
 
-  /* For now, cheat and set the error to zero in all cases.
-   */
-
-  *err = 0.0;
+/* ================================================== */
 
-  /* Call system specific driver to get correction */
-  (*drv_offset_convert)(&raw, &correction);
-  UTI_AddDoubleToTimeval(&raw, correction, result);
+void
+LCL_CookTime(struct timeval *raw, struct timeval *cooked, double *err)
+{
+  double correction;
 
-  return;
+  LCL_GetOffsetCorrection(raw, &correction, err);
+  UTI_AddDoubleToTimeval(raw, correction, cooked);
 }
 
 /* ================================================== */
 
-double
-LCL_GetOffsetCorrection(struct timeval *raw)
+void
+LCL_GetOffsetCorrection(struct timeval *raw, double *correction, double *err)
 {
-  double correction;
-  (*drv_offset_convert)(raw, &correction);
-  return correction;
+  double e;
+
+  /* Call system specific driver to get correction */
+  (*drv_offset_convert)(raw, correction, &e);
+
+  if (err)
+    *err = e;
 }
 
 /* ================================================== */
@@ -370,7 +372,6 @@ LCL_SetAbsoluteFrequency(double afreq_ppm)
 {
   ChangeListEntry *ptr;
   struct timeval raw, cooked;
-  double correction;
   double dfreq;
   
   /* Call the system-specific driver for setting the frequency */
@@ -380,8 +381,7 @@ LCL_SetAbsoluteFrequency(double afreq_ppm)
   dfreq = 1.0e-6 * (afreq_ppm - current_freq_ppm) / (1.0 - 1.0e-6 * current_freq_ppm);
 
   LCL_ReadRawTime(&raw);
-  (drv_offset_convert)(&raw, &correction);
-  UTI_AddDoubleToTimeval(&raw, correction, &cooked);
+  LCL_CookTime(&raw, &cooked, NULL);
 
   /* Dispatch to all handlers */
   for (ptr = change_list.next; ptr != &change_list; ptr = ptr->next) {
@@ -399,7 +399,6 @@ LCL_AccumulateDeltaFrequency(double dfreq)
 {
   ChangeListEntry *ptr;
   struct timeval raw, cooked;
-  double correction;
 
   /* Work out new absolute frequency.  Note that absolute frequencies
    are handled in units of ppm, whereas the 'dfreq' argument is in
@@ -412,8 +411,7 @@ LCL_AccumulateDeltaFrequency(double dfreq)
   (*drv_set_freq)(current_freq_ppm);
 
   LCL_ReadRawTime(&raw);
-  (drv_offset_convert)(&raw, &correction);
-  UTI_AddDoubleToTimeval(&raw, correction, &cooked);
+  LCL_CookTime(&raw, &cooked, NULL);
 
   /* Dispatch to all handlers */
   for (ptr = change_list.next; ptr != &change_list; ptr = ptr->next) {
@@ -429,14 +427,12 @@ LCL_AccumulateOffset(double offset)
 {
   ChangeListEntry *ptr;
   struct timeval raw, cooked;
-  double correction;
 
   /* In this case, the cooked time to be passed to the notify clients
      has to be the cooked time BEFORE the change was made */
 
   LCL_ReadRawTime(&raw);
-  (drv_offset_convert)(&raw, &correction);
-  UTI_AddDoubleToTimeval(&raw, correction, &cooked);
+  LCL_CookTime(&raw, &cooked, NULL);
 
   (*drv_accrue_offset)(offset);
 
@@ -454,14 +450,12 @@ LCL_ApplyStepOffset(double offset)
 {
   ChangeListEntry *ptr;
   struct timeval raw, cooked;
-  double correction;
 
   /* In this case, the cooked time to be passed to the notify clients
      has to be the cooked time BEFORE the change was made */
 
   LCL_ReadRawTime(&raw);
-  (drv_offset_convert)(&raw, &correction);
-  UTI_AddDoubleToTimeval(&raw, correction, &cooked);
+  LCL_CookTime(&raw, &cooked, NULL);
 
   (*drv_apply_step_offset)(offset);
 
@@ -479,14 +473,12 @@ LCL_AccumulateFrequencyAndOffset(double dfreq, double doffset)
 {
   ChangeListEntry *ptr;
   struct timeval raw, cooked;
-  double correction;
   double old_freq_ppm;
 
   LCL_ReadRawTime(&raw);
-  (drv_offset_convert)(&raw, &correction);
   /* Due to modifying the offset, this has to be the cooked time prior
      to the change we are about to make */
-  UTI_AddDoubleToTimeval(&raw, correction, &cooked);
+  LCL_CookTime(&raw, &cooked, NULL);
 
   old_freq_ppm = current_freq_ppm;
 
@@ -563,7 +555,7 @@ LCL_MakeStep(double threshold)
   double correction;
 
   LCL_ReadRawTime(&raw);
-  correction = LCL_GetOffsetCorrection(&raw);
+  LCL_GetOffsetCorrection(&raw, &correction, NULL);
 
   if (fabs(correction) <= threshold)
     return 0;
diff --git a/local.h b/local.h
index 98899a9cc388eff53a43faf7be781bfb8d931385..bef1a3e01d82a02cf95ba65b5d17336030c9e3ad 100644 (file)
--- a/local.h
+++ b/local.h
@@ -50,11 +50,13 @@ extern void LCL_ReadRawTime(struct timeval *);
 
 extern void LCL_ReadCookedTime(struct timeval *t, double *err);
 
+/* Convert raw time to cooked. */
+extern void LCL_CookTime(struct timeval *raw, struct timeval *cooked, double *err);
+
 /* Read the current offset between the system clock and true time
-   (i.e. 'cooked' - 'raw') (in seconds).  Only intended for use in
-   status reporting, really. */
+   (i.e. 'cooked' - 'raw') (in seconds). */
 
-extern double LCL_GetOffsetCorrection(struct timeval *raw);
+extern void LCL_GetOffsetCorrection(struct timeval *raw, double *correction, double *err);
 
 /* Type of routines that may be invoked as callbacks when there is a
    change to the frequency or offset.
index 47d7eb12434907b74dd4bc21540bb543a5fd1fec..6f78d1dfbd51d33e226204487c7aef6b24d76048 100644 (file)
--- a/localp.h
+++ b/localp.h
@@ -54,7 +54,7 @@ typedef void (*lcl_ApplyStepOffsetDriver)(double offset);
 /* System driver to convert a raw time to an adjusted (cooked) time.
    The number of seconds returned in 'corr' have to be added to the
    raw time to get the corrected time */
-typedef void (*lcl_OffsetCorrectionDriver)(struct timeval *raw, double *corr);
+typedef void (*lcl_OffsetCorrectionDriver)(struct timeval *raw, double *corr, double *err);
 
 /* System driver to schedule leap second */
 typedef void (*lcl_SetLeapDriver)(int leap);
index 34b73aea3a153bd3cfdbef6dad3281cd0007496c..f3e98e1f50868e14b8ca8542aa6cb1c768d9fba7 100644 (file)
--- a/manual.c
+++ b/manual.c
@@ -188,14 +188,13 @@ int
 MNL_AcceptTimestamp(struct timeval *ts, long *offset_cs, double *dfreq_ppm, double *new_afreq_ppm)
 {
   struct timeval now;
-  double local_clock_err;
   double offset;
   int i;
 
   if (enabled) {
 
     /* Check whether timestamp is within margin of old one */
-    LCL_ReadCookedTime(&now, &local_clock_err);
+    LCL_ReadCookedTime(&now, NULL);
 
     UTI_DiffTimevalsToDouble(&offset, &now, ts);
 
@@ -303,7 +302,6 @@ MNL_DeleteSample(int index)
 {
   int i;
   struct timeval now;
-  double local_clock_err;
 
   if ((index < 0) || (index >= n_samples)) {
     return 0;
@@ -319,7 +317,7 @@ MNL_DeleteSample(int index)
 
   /* Now re-estimate.  NULLs because we don't want the parameters back
      in this case. */
-  LCL_ReadCookedTime(&now, &local_clock_err);
+  LCL_ReadCookedTime(&now, NULL);
   estimate_and_set_system(&now, 0, 0.0, NULL, NULL, NULL);
 
   return 1;
index 84a47e3ae1e29d84b34053e9ac6f5d57b0816dee..7b2d7174d47f656a9049b956bc64b066a844fb2f 100644 (file)
@@ -523,7 +523,6 @@ transmit_packet(NTP_Mode my_mode, /* The mode this machine wants to be */
   NTP_Packet message;
   int version;
   int leap;
-  double local_time_err;
   struct timeval local_transmit;
 
   /* Parameters read from reference module */
@@ -535,7 +534,7 @@ transmit_packet(NTP_Mode my_mode, /* The mode this machine wants to be */
 
   version = 3;
 
-  LCL_ReadCookedTime(&local_transmit, &local_time_err);
+  LCL_ReadCookedTime(&local_transmit, NULL);
   REF_GetReferenceParams(&local_transmit,
                          &are_we_synchronised, &leap_status,
                          &our_stratum,
@@ -582,7 +581,7 @@ transmit_packet(NTP_Mode my_mode, /* The mode this machine wants to be */
   /* Transmit - this our local time right now!  Also, we might need to
      store this for our own use later, next time we receive a message
      from the source we're sending to now. */
-  LCL_ReadCookedTime(&local_transmit, &local_time_err);
+  LCL_ReadCookedTime(&local_transmit, NULL);
 
   /* Authenticate */
   if (do_auth) {
index 48802e497883164bc385365cc463a650519036b3..1841b9c585831fecf4eb061149ccefcd1253890b 100644 (file)
--- a/ntp_io.c
+++ b/ntp_io.c
@@ -281,6 +281,7 @@ read_from_socket(void *anything)
   union sockaddr_in46 where_from;
   unsigned int flags = 0;
   struct timeval now;
+  double now_err;
   NTP_Remote_Address remote_addr;
   char cmsgbuf[256];
   struct msghdr msg;
@@ -289,7 +290,7 @@ read_from_socket(void *anything)
 
   assert(initialised);
 
-  SCH_GetFileReadyTime(&now);
+  SCH_GetFileReadyTime(&now, &now_err);
 
   iov.iov_base = message.arbitrary;
   iov.iov_len = sizeof(message);
@@ -346,16 +347,9 @@ read_from_socket(void *anything)
 #ifdef SO_TIMESTAMP
       if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SO_TIMESTAMP) {
         struct timeval tv;
-        double correction;
 
         memcpy(&tv, CMSG_DATA(cmsg), sizeof(tv));
-        correction = LCL_GetOffsetCorrection(&tv);
-        UTI_AddDoubleToTimeval(&tv, correction, &tv);
-#if 0
-        UTI_DiffTimevalsToDouble(&correction, &now, &tv);
-        LOG(LOGS_INFO, LOGF_NtpIO, "timestamp diff: %f", correction);
-#endif
-        now = tv;
+        LCL_CookTime(&tv, &now, &now_err);
       }
 #endif
     }
index a419800ced6da211bd2287ff7644dc6f8232c700..f4e42a1bb38832ed040d7ac39401b030813301b5 100644 (file)
@@ -317,10 +317,10 @@ RCL_GetDriverOption(RCL_Instance instance, char *name)
 int
 RCL_AddSample(RCL_Instance instance, struct timeval *sample_time, double offset, NTP_Leap leap_status)
 {
-  double correction;
+  double correction, err;
   struct timeval cooked_time;
 
-  correction = LCL_GetOffsetCorrection(sample_time);
+  LCL_GetOffsetCorrection(sample_time, &correction, &err);
   UTI_AddDoubleToTimeval(sample_time, correction, &cooked_time);
 
   if (!valid_sample_time(instance, sample_time))
@@ -342,7 +342,7 @@ RCL_AddSample(RCL_Instance instance, struct timeval *sample_time, double offset,
 int
 RCL_AddPulse(RCL_Instance instance, struct timeval *pulse_time, double second)
 {
-  double correction, offset;
+  double correction, err, offset;
   struct timeval cooked_time;
   int rate;
 
@@ -352,7 +352,7 @@ RCL_AddPulse(RCL_Instance instance, struct timeval *pulse_time, double second)
   NTP_Leap leap;
   unsigned long ref_id;
 
-  correction = LCL_GetOffsetCorrection(pulse_time);
+  LCL_GetOffsetCorrection(pulse_time, &correction, &err);
   UTI_AddDoubleToTimeval(pulse_time, correction, &cooked_time);
 
   if (!valid_sample_time(instance, pulse_time))
index af8baa15b13de4e1b2dafbbeb6dd35529dbdb20a..3e85e35a9f549db2ff2bc334cc99d7538cf51478 100644 (file)
@@ -573,11 +573,10 @@ REF_SetUnsynchronised(void)
 {
   /* Variables required for logging to statistics log */
   struct timeval now;
-  double local_clock_err;
 
   assert(initialised);
 
-  LCL_ReadCookedTime(&now, &local_clock_err);
+  LCL_ReadCookedTime(&now, NULL);
 
   write_log(&now,
             "0.0.0.0",
@@ -725,7 +724,7 @@ REF_GetTrackingReport(RPT_TrackingReport *rep)
   double correction;
 
   LCL_ReadRawTime(&now_raw);
-  correction = LCL_GetOffsetCorrection(&now_raw);
+  LCL_GetOffsetCorrection(&now_raw, &correction, NULL);
   UTI_AddDoubleToTimeval(&now_raw, correction, &now_cooked);
 
   if (are_we_synchronised) {
index 582a8b5cea7b72144fe1d498a0fd34db551a9135..786e7f8fc1413cdf467285e72a21b77984caa475 100644 (file)
@@ -911,7 +911,7 @@ read_from_device(void *any)
     /* Read RTC time, sandwiched between two polls of the system clock
        so we can bound any error. */
 
-    SCH_GetFileReadyTime(&sys_time);
+    SCH_GetFileReadyTime(&sys_time, NULL);
 
     status = ioctl(fd, RTC_RD_TIME, &rtc_raw);
     if (status < 0) {
@@ -1139,7 +1139,6 @@ int
 RTC_Linux_Trim(void)
 {
   struct timeval now;
-  double local_clock_err;
 
 
   /* Remember the slope coefficient - we won't be able to determine a
@@ -1158,7 +1157,7 @@ RTC_Linux_Trim(void)
        want |E| <= 0.5, which implies R <= S <= R+1, i.e. R is just
        the rounded down part of S, i.e. the seconds part. */
 
-    LCL_ReadCookedTime(&now, &local_clock_err);
+    LCL_ReadCookedTime(&now, NULL);
     
     set_rtc(now.tv_sec);
 
diff --git a/sched.c b/sched.c
index 6412f0a4f3aeea188acb94f7b9ed965a7c76ec58..c2d44b912b49389fa0029bc23e85cd11fe48192a 100644 (file)
--- a/sched.c
+++ b/sched.c
@@ -73,6 +73,7 @@ static FileHandlerEntry file_handlers[FD_SET_SIZE];
 
 /* Last timestamp when a file descriptor became readable */
 static struct timeval last_fdready;
+static double last_fdready_err;
 
 /* ================================================== */
 
@@ -229,9 +230,11 @@ SCH_RemoveInputFileHandler(int fd)
 /* ================================================== */
 
 void
-SCH_GetFileReadyTime(struct timeval *tv)
+SCH_GetFileReadyTime(struct timeval *tv, double *err)
 {
   *tv = last_fdready;
+  if (err)
+    *err = last_fdready_err;
 }
 
 /* ================================================== */
@@ -525,7 +528,6 @@ SCH_MainLoop(void)
   int status;
   struct timeval tv, *ptv;
   struct timeval now;
-  double err;
 
   if (!initialised) {
     CROAK("Should be initialised");
@@ -570,7 +572,7 @@ SCH_MainLoop(void)
     } else if (status > 0) {
       /* A file descriptor is ready to read */
 
-      LCL_ReadCookedTime(&last_fdready, &err);
+      LCL_ReadCookedTime(&last_fdready, &last_fdready_err);
       dispatch_filehandlers(status, &rd);
 
     } else {
diff --git a/sched.h b/sched.h
index 0aea7ff9112cf7049597bf20462294dcc152d345..143c4c30f28028090da1ec9b338fb859bcd20dac 100644 (file)
--- a/sched.h
+++ b/sched.h
@@ -62,7 +62,7 @@ extern void SCH_RemoveInputFileHandler(int fd);
 
 /* Get the time (cooked) when file descriptor became ready, intended for use
    in file handlers */
-extern void SCH_GetFileReadyTime(struct timeval *tv);
+extern void SCH_GetFileReadyTime(struct timeval *tv, double *err);
 
 /* This queues a timeout to elapse at a given (raw) local time */
 extern SCH_TimeoutID SCH_AddTimeout(struct timeval *tv, SCH_TimeoutHandler, SCH_ArbitraryArgument);
index 03b6fb68fb4266c2fbe30eadb9c4e176165dac86..f27583b015bca4d7ab83d43c3a474ef12c38d119 100644 (file)
--- a/sources.c
+++ b/sources.c
@@ -385,7 +385,6 @@ SRC_SelectSource(unsigned long match_addr)
 {
   int i, j, index;
   struct timeval now;
-  double local_clock_err;
   int src_select_ok;
   double src_offset, src_offset_sd, src_frequency, src_skew;
   double src_accrued_dispersion;
@@ -412,7 +411,7 @@ SRC_SelectSource(unsigned long match_addr)
     return;
   }
 
-  LCL_ReadCookedTime(&now, &local_clock_err);
+  LCL_ReadCookedTime(&now, NULL);
 
   /* Step 1 - build intervals about each source */
   n_endpoints = 0;
@@ -704,7 +703,7 @@ SRC_SelectSource(unsigned long match_addr)
         /* Now just use the statistics of the selected source for
            trimming the local clock */
 
-        LCL_ReadCookedTime(&now, &local_clock_err);
+        LCL_ReadCookedTime(&now, NULL);
 
         SST_GetTrackingData(sources[selected_source_index]->stats, &now,
                             &src_offset, &src_offset_sd,
index f46b05567d06c2f3e71e7f599170d6bab211d148..6c6a64a06d21fe492813c9b446cfdfd65f652dce 100644 (file)
@@ -538,7 +538,7 @@ read_frequency(void)
 
 static void
 get_offset_correction(struct timeval *raw,
-                      double *corr)
+                      double *corr, double *err)
 {
 
   /* Correction is given by these things :
@@ -602,6 +602,7 @@ again:
   }  
 
   *corr = - (offset_register + fast_slew_remaining) + adjtime_left;
+  *err = 0.0;
 
   return;
 }
index 4641ee4f25eafb57335af561cc0f65a19ddc4af9..4b921e7a941939983fd985230dbf884333e7cca4 100644 (file)
@@ -264,11 +264,12 @@ read_frequency(void)
 
 static void
 get_offset_correction(struct timeval *raw,
-                      double *corr)
+                      double *corr, double *err)
 {
   stop_adjust();
   *corr = -offset_register;
   start_adjust();
+  *err = 0.0;
 }
 
 /* ================================================== */
index 6c6570582c71ad4120ae461bb8b38c19d0943796..40a863df08bee6835d24350af370c0b4008c1068 100644 (file)
@@ -293,11 +293,12 @@ read_frequency(void)
 
 static void
 get_offset_correction(struct timeval *raw,
-                      double *corr)
+                      double *corr, double *err)
 {
   stop_adjust();
   *corr = -offset_register;
   start_adjust();
+  *err = 0.0;
   return;
 }
 
index 13bb262144d5efe78ef2d392498bc2873b13049d..6a98f512dcef17ecfc5c85625e6ec8ce526a9532 100644 (file)
@@ -280,11 +280,12 @@ read_frequency(void)
 
 static void
 get_offset_correction(struct timeval *raw,
-                      double *corr)
+                      double *corr, double *err)
 {
   stop_adjust();
   *corr = -offset_register;
   start_adjust();
+  *err = 0.0;
   return;
 }