Uninitialized vector entry?
[minix3.git] / lib / timers / tmrs_clr.c
blobb8d2a732a2b8ebde01f0c768b65b82d16f7a2d06
1 #include "timers.h"
3 /*===========================================================================*
4 * tmrs_clrtimer *
5 *===========================================================================*/
6 clock_t tmrs_clrtimer(tmrs, tp, next_time)
7 timer_t **tmrs; /* pointer to timers queue */
8 timer_t *tp; /* timer to be removed */
9 clock_t *next_time;
11 /* Deactivate a timer and remove it from the timers queue.
13 timer_t **atp;
14 struct proc *p;
15 clock_t prev_time;
17 if(*tmrs)
18 prev_time = (*tmrs)->tmr_exp_time;
19 else
20 prev_time = 0;
22 tp->tmr_exp_time = TMR_NEVER;
24 for (atp = tmrs; *atp != NULL; atp = &(*atp)->tmr_next) {
25 if (*atp == tp) {
26 *atp = tp->tmr_next;
27 break;
31 if(next_time) {
32 if(*tmrs)
33 *next_time = (*tmrs)->tmr_exp_time;
34 else
35 *next_time = 0;
38 return prev_time;