reference: fix adjusting of last reference update time

The timestamp is in cooked time, it needs to be adjusted on all changes,
not only on step.
This commit is contained in:
Miroslav Lichvar 2014-06-06 11:19:03 +02:00
parent 79ac20c161
commit 9b630a0664

View file

@ -147,11 +147,13 @@ handle_slew(struct timeval *raw,
LCL_ChangeType change_type, LCL_ChangeType change_type,
void *anything) void *anything)
{ {
double delta;
if (change_type == LCL_ChangeUnknownStep) { if (change_type == LCL_ChangeUnknownStep) {
last_ref_update.tv_sec = 0; last_ref_update.tv_sec = 0;
last_ref_update.tv_usec = 0; last_ref_update.tv_usec = 0;
} else if (change_type == LCL_ChangeStep) { } else if (last_ref_update.tv_sec) {
UTI_AddDoubleToTimeval(&last_ref_update, -doffset, &last_ref_update); UTI_AdjustTimeval(&last_ref_update, cooked, &last_ref_update, &delta, dfreq, doffset);
} }
} }