mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 17:35:06 -05:00
Add makestep directive
This commit is contained in:
7
local.c
7
local.c
@@ -555,10 +555,10 @@ lcl_RegisterSystemDrivers(lcl_ReadFrequencyDriver read_freq,
|
||||
|
||||
/* ================================================== */
|
||||
/* Look at the current difference between the system time and the NTP
|
||||
time, and make a step to cancel it. */
|
||||
time, and make a step to cancel it if it's larger than the threshold. */
|
||||
|
||||
int
|
||||
LCL_MakeStep(void)
|
||||
LCL_MakeStep(double threshold)
|
||||
{
|
||||
struct timeval raw;
|
||||
double correction;
|
||||
@@ -566,6 +566,9 @@ LCL_MakeStep(void)
|
||||
LCL_ReadRawTime(&raw);
|
||||
correction = LCL_GetOffsetCorrection(&raw);
|
||||
|
||||
if (fabs(correction) <= threshold)
|
||||
return 0;
|
||||
|
||||
/* Cancel remaining slew and make the step */
|
||||
LCL_AccumulateOffset(correction);
|
||||
LCL_ApplyStepOffset(-correction);
|
||||
|
||||
Reference in New Issue
Block a user