mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 00:45:07 -05:00
sched: include unexpected jumps in monotonic time
Update the monotonic time before the timestamps are corrected for unexpected jumps, e.g. due to the computer being suspended and resumed, and switch to the raw timestamps. This should allow the NTS refresh interval to better follow real time, but it will not be corrected for a frequency offset if the clock is not synchronized (e.g. with -x).
This commit is contained in:
4
sched.c
4
sched.c
@@ -799,14 +799,14 @@ SCH_MainLoop(void)
|
||||
LCL_ReadRawTime(&now);
|
||||
LCL_CookTime(&now, &cooked, &err);
|
||||
|
||||
update_monotonic_time(&now, &last_select_ts_raw);
|
||||
|
||||
/* Check if the time didn't jump unexpectedly */
|
||||
if (!check_current_time(&saved_now, &now, status == 0, &saved_tv, ptv)) {
|
||||
/* Cook the time again after handling the step */
|
||||
LCL_CookTime(&now, &cooked, &err);
|
||||
}
|
||||
|
||||
update_monotonic_time(&cooked, &last_select_ts);
|
||||
|
||||
last_select_ts_raw = now;
|
||||
last_select_ts = cooked;
|
||||
last_select_ts_err = err;
|
||||
|
||||
Reference in New Issue
Block a user