static int n_started_sources;
static int n_completed_sources;
-static int init_slew_threshold = -1;
+static double init_slew_threshold;
union sockaddr_in46 {
struct sockaddr_in in4;
the system clock is fast of the reference, i.e. it needs to be
stepped backwards. */
- if (fabs(estimated_offset) > (double) init_slew_threshold) {
+ if (fabs(estimated_offset) > init_slew_threshold) {
LOG(LOGS_INFO, LOGF_Acquire, "System's initial offset : %.6f seconds %s of true (step)",
fabs(estimated_offset),
(estimated_offset >= 0) ? "fast" : "slow");
/* ================================================== */
void
-ACQ_StartAcquisition(int n, IPAddr *ip_addrs, int threshold, void (*after_hook)(void *), void *anything)
+ACQ_StartAcquisition(int n, IPAddr *ip_addrs, double threshold, void (*after_hook)(void *), void *anything)
{
int i, ip4, ip6;
extern void ACQ_Finalise(void);
-extern void ACQ_StartAcquisition(int n, IPAddr *ip_addrs, int init_slew_threshold,
+extern void ACQ_StartAcquisition(int n, IPAddr *ip_addrs, double init_slew_threshold,
void (*after_hook)(void *), void *anything);
extern void ACQ_AccumulateSample(ACQ_Source acq_source, double offset, double root_distance);
/* Threshold (in seconds) - if absolute value of initial error is less
than this, slew instead of stepping */
-static int init_slew_threshold = -1;
+static double init_slew_threshold;
#define MAX_INIT_SRCS 8
static IPAddr init_srcs_ip[MAX_INIT_SRCS];
const char *p;
char hostname[HOSTNAME_LEN+1];
int n;
- int threshold;
IPAddr ip_addr;
/* Ignore the line if chronyd was started with -R. */
n_init_srcs = 0;
p = line;
- if (sscanf(p, "%d%n", &threshold, &n) == 1) {
+ if (sscanf(p, "%lf%n", &init_slew_threshold, &n) == 1) {
p += n;
} else {
LOG(LOGS_WARN, LOGF_Configure, "Could not parse initstepslew threshold at line %d", line_number);
}
if (n_init_srcs > 0) {
do_init_stepslew = 1;
- init_slew_threshold = threshold;
} else {
LOG(LOGS_WARN, LOGF_Configure, "No usable initstepslew servers at line %d\n", line_number);
}