]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Adjust last_select_ts on slew
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 6 Jun 2013 14:28:33 +0000 (16:28 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 6 Jun 2013 14:29:50 +0000 (16:29 +0200)
sched.c

diff --git a/sched.c b/sched.c
index 321c16f6bc38135f91850ba24f6ef4da278de1ec..06eed1bbca80c1b463eaf4612f668f229d685563 100644 (file)
--- a/sched.c
+++ b/sched.c
@@ -507,12 +507,11 @@ handle_slew(struct timeval *raw,
             void *anything)
 {
   TimerQueueEntry *ptr;
+  double delta;
   int i;
 
   if (is_step_change) {
-    /* We're not interested in anything else - it won't affect the
-       functionality of timer event dispatching.  If a step change
-       occurs, just shift all the timeouts by the offset */
+    /* If a step change occurs, just shift all raw time stamps by the offset */
     
     for (ptr = timer_queue.next; ptr != &timer_queue; ptr = ptr->next) {
       UTI_AddDoubleToTimeval(&ptr->tv, -doffset, &ptr->tv);
@@ -523,8 +522,9 @@ handle_slew(struct timeval *raw,
     }
 
     UTI_AddDoubleToTimeval(&last_select_ts_raw, -doffset, &last_select_ts_raw);
-    UTI_AddDoubleToTimeval(&last_select_ts, -doffset, &last_select_ts);
   }
+
+  UTI_AdjustTimeval(&last_select_ts, cooked, &last_select_ts, &delta, dfreq, doffset);
 }
 
 /* ================================================== */