mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 03:15:07 -05:00
main: cancel clock correction before dumping sources
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.
This commit is contained in:
13
local.c
13
local.c
@@ -687,6 +687,19 @@ LCL_MakeStep(void)
|
|||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|
||||||
|
void
|
||||||
|
LCL_CancelOffsetCorrection(void)
|
||||||
|
{
|
||||||
|
struct timespec raw;
|
||||||
|
double correction;
|
||||||
|
|
||||||
|
LCL_ReadRawTime(&raw);
|
||||||
|
LCL_GetOffsetCorrection(&raw, &correction, NULL);
|
||||||
|
LCL_AccumulateOffset(correction, 0.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ================================================== */
|
||||||
|
|
||||||
int
|
int
|
||||||
LCL_CanSystemLeap(void)
|
LCL_CanSystemLeap(void)
|
||||||
{
|
{
|
||||||
|
|||||||
3
local.h
3
local.h
@@ -197,6 +197,9 @@ extern void LCL_Finalise(void);
|
|||||||
to a timezone problem. */
|
to a timezone problem. */
|
||||||
extern int LCL_MakeStep(void);
|
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
|
/* Check if the system driver supports leap seconds, i.e. LCL_SetSystemLeap
|
||||||
does something */
|
does something */
|
||||||
extern int LCL_CanSystemLeap(void);
|
extern int LCL_CanSystemLeap(void);
|
||||||
|
|||||||
1
main.c
1
main.c
@@ -104,6 +104,7 @@ MAI_CleanupAndExit(void)
|
|||||||
{
|
{
|
||||||
if (!initialised) exit(exit_status);
|
if (!initialised) exit(exit_status);
|
||||||
|
|
||||||
|
LCL_CancelOffsetCorrection();
|
||||||
SRC_DumpSources();
|
SRC_DumpSources();
|
||||||
|
|
||||||
/* Don't update clock when removing sources */
|
/* Don't update clock when removing sources */
|
||||||
|
|||||||
Reference in New Issue
Block a user