On exit, cancel the remaining clock correction before measurements are
saved to dumpdir to fix them for the state in which chronyd will start
again.
/* ================================================== */
+void
+LCL_CancelOffsetCorrection(void)
+{
+ struct timespec raw;
+ double correction;
+
+ LCL_ReadRawTime(&raw);
+ LCL_GetOffsetCorrection(&raw, &correction, NULL);
+ LCL_AccumulateOffset(correction, 0.0);
+}
+
+/* ================================================== */
+
int
LCL_CanSystemLeap(void)
{
to a timezone problem. */
extern int LCL_MakeStep(void);
+/* Routine to cancel the outstanding system clock correction */
+extern void LCL_CancelOffsetCorrection(void);
+
/* Check if the system driver supports leap seconds, i.e. LCL_SetSystemLeap
does something */
extern int LCL_CanSystemLeap(void);
{
if (!initialised) exit(exit_status);
+ LCL_CancelOffsetCorrection();
SRC_DumpSources();
/* Don't update clock when removing sources */