hwclock: fix check of sample separation

This commit is contained in:
Miroslav Lichvar 2016-12-08 11:21:13 +01:00
parent 859e0c2323
commit a2d2cad384

View file

@ -112,7 +112,7 @@ int
HCL_NeedsNewSample(HCL_Instance clock, struct timespec *now) HCL_NeedsNewSample(HCL_Instance clock, struct timespec *now)
{ {
if (!clock->n_samples || if (!clock->n_samples ||
fabs(UTI_DiffTimespecsToDouble(now, &clock->local_ref) >= MIN_SAMPLE_SEPARATION)) fabs(UTI_DiffTimespecsToDouble(now, &clock->local_ref)) >= MIN_SAMPLE_SEPARATION)
return 1; return 1;
return 0; return 0;