diff src/timer.c @ 155:6749f6639924

Fix bug for STAILQ that fail to remove a node. The previous one should be re-linked to next of removed one. But, it is linked to the removed one. Fix it!
author Thinker K.F. Li <thinker@branda.to>
date Wed, 01 Oct 2008 14:46:08 +0800
parents c986e45c1e91
children c7e5b8779bb5
line wrap: on
line diff
--- a/src/timer.c	Tue Sep 30 02:44:06 2008 +0800
+++ b/src/timer.c	Wed Oct 01 14:46:08 2008 +0800
@@ -61,7 +61,8 @@
     for(visit = STAILQ_HEAD(tman->timers);
 	visit != NULL;
 	visit = STAILQ_NEXT(mb_timer_t, next, visit)) {
-	if(MB_TIMEVAL_LATER(&visit->tmo, tmo))
+	if(MB_TIMEVAL_LATER(&visit->tmo, tmo) ||
+	   MB_TIMEVAL_EQ(&visit->tmo, tmo))
 	    break;
 	last = visit;
     }