mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 17:55:07 -05:00
hwclock: don't drop valid samples in HCL_ProcessReadings()
Modify the HCL_ProcessReadings() function to try to always provide a valid sample. Instead of dropping a sample outside of the expected delay, provide its assumed quality level as a small integer (relative to already accumulated samples), and let the caller decide what quality is acceptable.
This commit is contained in:
@@ -519,7 +519,7 @@ poll_phc(struct Interface *iface, struct timespec *now)
|
||||
struct timespec sample_phc_ts, sample_sys_ts, sample_local_ts;
|
||||
struct timespec phc_readings[PHC_READINGS][3];
|
||||
double phc_err, local_err, interval;
|
||||
int n_readings;
|
||||
int n_readings, quality;
|
||||
|
||||
if (!HCL_NeedsNewSample(iface->clock, now))
|
||||
return;
|
||||
@@ -543,7 +543,8 @@ poll_phc(struct Interface *iface, struct timespec *now)
|
||||
return;
|
||||
|
||||
if (!HCL_ProcessReadings(iface->clock, n_readings, phc_readings,
|
||||
&sample_phc_ts, &sample_sys_ts, &phc_err))
|
||||
&sample_phc_ts, &sample_sys_ts, &phc_err, &quality) ||
|
||||
quality <= 0)
|
||||
return;
|
||||
|
||||
LCL_CookTime(&sample_sys_ts, &sample_local_ts, &local_err);
|
||||
|
||||
Reference in New Issue
Block a user