mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 18:05:06 -05:00
local+reference: fix tracking offset after failed step
If a clock step enabled by the makestep directive or requested by the makestep command fails, accumulate the missing step back to keep the tracking offset valid. This fixes time served by an instance configured with the makestep directive and the -x option (the null driver cannot perform steps) at the same time. It will still generate error log messages.
This commit is contained in:
5
local.c
5
local.c
@@ -695,8 +695,11 @@ LCL_MakeStep(void)
|
||||
|
||||
/* Cancel remaining slew and make the step */
|
||||
LCL_AccumulateOffset(correction, 0.0);
|
||||
if (!LCL_ApplyStepOffset(-correction))
|
||||
if (!LCL_ApplyStepOffset(-correction)) {
|
||||
/* Revert the correction */
|
||||
LCL_AccumulateOffset(-correction, 0.0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
LOG(LOGS_WARN, "System clock was stepped by %.6f seconds", correction);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user