]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Don't forget to shift last class dispatch timevals on step
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 20 Dec 2010 13:12:47 +0000 (14:12 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 20 Dec 2010 13:12:47 +0000 (14:12 +0100)
sched.c

diff --git a/sched.c b/sched.c
index 9324e01e1c23f04ed8e495af31039d69767a55a1..39fa7d0a2a5c65b1639005b9a5e34dbf9b09cb97 100644 (file)
--- a/sched.c
+++ b/sched.c
@@ -496,7 +496,7 @@ handle_slew(struct timeval *raw,
             void *anything)
 {
   TimerQueueEntry *ptr;
-  struct timeval T1;
+  int i;
 
   if (is_step_change) {
     /* We're not interested in anything else - it won't affect the
@@ -504,10 +504,12 @@ handle_slew(struct timeval *raw,
        occurs, just shift all the timeouts by the offset */
     
     for (ptr = timer_queue.next; ptr != &timer_queue; ptr = ptr->next) {
-      UTI_AddDoubleToTimeval(&ptr->tv, -doffset, &T1);
-      ptr->tv = T1;
+      UTI_AddDoubleToTimeval(&ptr->tv, -doffset, &ptr->tv);
     }
 
+    for (i = 0; i < SCH_NumberOfClasses; i++) {
+      UTI_AddDoubleToTimeval(&last_class_dispatch[i], -doffset, &last_class_dispatch[i]);
+    }
   }
 }