diff options
Diffstat (limited to 'usr.sbin/rtadvd/timer.c')
-rw-r--r-- | usr.sbin/rtadvd/timer.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.sbin/rtadvd/timer.c b/usr.sbin/rtadvd/timer.c index 73b7fe1..f30fb37 100644 --- a/usr.sbin/rtadvd/timer.c +++ b/usr.sbin/rtadvd/timer.c @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $KAME: timer.c,v 1.4 2000/05/27 11:30:43 jinmei Exp $ */ +/* $KAME: timer.c,v 1.9 2002/06/10 19:59:47 itojun Exp $ */ /* * Copyright (C) 1998 WIDE Project. @@ -45,7 +45,7 @@ static struct rtadvd_timer timer_head; #define MILLION 1000000 #define TIMEVAL_EQUAL(t1,t2) ((t1)->tv_sec == (t2)->tv_sec &&\ - (t1)->tv_usec == (t2)->tv_usec) + (t1)->tv_usec == (t2)->tv_usec) static struct timeval tm_max = {0x7fffffff, 0x7fffffff}; @@ -75,7 +75,7 @@ rtadvd_add_timer(struct rtadvd_timer *(*timeout) __P((void *)), if (timeout == NULL) { syslog(LOG_ERR, - "<%s> timeout function unspecfied", __func__); + "<%s> timeout function unspecified", __func__); exit(1); } newtimer->expire = timeout; @@ -149,12 +149,10 @@ rtadvd_check_timer() if (TIMEVAL_EQUAL(&tm_max, &timer_head.tm)) { /* no need to timeout */ return(NULL); - } - else if (TIMEVAL_LT(timer_head.tm, now)) { + } else if (TIMEVAL_LT(timer_head.tm, now)) { /* this may occur when the interval is too small */ returnval.tv_sec = returnval.tv_usec = 0; - } - else + } else TIMEVAL_SUB(&timer_head.tm, &now, &returnval); return(&returnval); } |