]> git.proxmox.com Git - mirror_frr.git/commitdiff
[lib] Fix timer precision.
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
Mon, 10 Nov 2008 08:33:30 +0000 (09:33 +0100)
committerPaul Jakma <paul@quagga.net>
Sat, 29 Nov 2008 18:04:22 +0000 (18:04 +0000)
Whenever a thread adds an timer funcname_thread_add_timer_timeval() gets called
to add the timer. Before adding the timer a quagga_gettimeofday() call
is made to do some time house keeping. However quagga_gettimeofday() only
updates recent_time, not relative_time that is used to calculate
the alarm_time. Replace with quagga_get_relative (NULL)

lib/thread.c

index 260e8c8e492c39198e0ae61c491edff488ebfb61..948bc210d7193f239da9d1a161e0041664a03438 100644 (file)
@@ -659,7 +659,7 @@ funcname_thread_add_timer_timeval (struct thread_master *m,
   thread = thread_get (m, type, func, arg, funcname);
 
   /* Do we need jitter here? */
-  quagga_gettimeofday (&recent_time);
+  quagga_get_relative (NULL);
   alarm_time.tv_sec = relative_time.tv_sec + time_relative->tv_sec;
   alarm_time.tv_usec = relative_time.tv_usec + time_relative->tv_usec;
   thread->u.sands = timeval_adjust(alarm_time);