From: Miroslav Lichvar Date: Tue, 20 Apr 2010 12:26:59 +0000 (+0200) Subject: Add dispersion after Linux makestep X-Git-Tag: 1.25-pre1~96 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c15db71f9e1182e90b7955169da30da16d80ecdd;p=thirdparty%2Fchrony.git Add dispersion after Linux makestep --- diff --git a/sys_linux.c b/sys_linux.c index 642899e6..406b9d66 100644 --- a/sys_linux.c +++ b/sys_linux.c @@ -528,6 +528,7 @@ apply_step_offset(double offset) { struct timeval old_time, new_time; struct timezone tz; + double err; if (fast_slewing) { abort_slew(); @@ -543,6 +544,13 @@ apply_step_offset(double offset) CROAK("settimeofday in apply_step_offset"); } + if (gettimeofday(&old_time, &tz) < 0) { + CROAK("gettimeofday in apply_step_offset"); + } + + UTI_DiffTimevalsToDouble(&err, &old_time, &new_time); + lcl_InvokeDispersionNotifyHandlers(fabs(err)); + initiate_slew(); }