From 6174e60abbcdc5b62a52fc03c373cee0b77ebcbf Mon Sep 17 00:00:00 2001 From: "/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org" Date: Tue, 22 Jan 2008 01:25:34 +0000 Subject: Max Kellermann : - Pass next_alarm to __run() only if there is an alarm - Eliminate the "timeout" parameter - the alarm functions get_next_alarm_run() and do_alarm_run() return an timeval pointer instead of a boolean --- src/alarm.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/alarm.c') diff --git a/src/alarm.c b/src/alarm.c index 2190bb6..883a42c 100644 --- a/src/alarm.c +++ b/src/alarm.c @@ -74,7 +74,7 @@ void del_alarm(struct alarm_list *alarm) } } -static int +static struct timeval * calculate_next_run(struct timeval *cand, struct timeval *tv, struct timeval *next_run) @@ -87,12 +87,13 @@ calculate_next_run(struct timeval *cand, next_run->tv_sec = 0; next_run->tv_usec = 0; } - return 1; + return next_run; } - return 0; + return NULL; } -int get_next_alarm_run(struct timeval *next_run) +struct timeval * +get_next_alarm_run(struct timeval *next_run) { int i; struct alarm_list *t; @@ -133,7 +134,8 @@ tv_compare(struct alarm_list *a, struct timeval *cur, struct timeval *cand) return 0; } -int do_alarm_run(struct timeval *next_run) +struct timeval * +do_alarm_run(struct timeval *next_run) { int i; struct alarm_list *t, *next, *prev; -- cgit v1.2.3