changeset 28119:98625ad8a015

(cancel_atimer): Break out of the loop as soon as timer has been found. Fix bug not computing timer's predecessor.
author Gerd Moellmann <gerd@gnu.org>
date Sun, 12 Mar 2000 17:01:02 +0000
parents 864231b74663
children ff3e24c96b80
files src/atimer.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/atimer.c	Sun Mar 12 16:24:20 2000 +0000
+++ b/src/atimer.c	Sun Mar 12 17:01:02 2000 +0000
@@ -176,7 +176,7 @@
       struct atimer **list = i ? &stopped_atimers : &atimers;
       
       /* See if TIMER is active or stopped.  */
-      for (t = *list, prev = 0; t && t != timer; t = t->next)
+      for (t = *list, prev = NULL; t && t != timer; prev = t, t = t->next)
 	;
 
       /* If it is, take it off the its list, and put in on the
@@ -191,6 +191,7 @@
 	  
 	  t->next = free_atimers;
 	  free_atimers = t;
+	  break;
 	}
     }