diff options
author | /C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org> | 2008-01-15 13:48:57 +0000 |
---|---|---|
committer | /C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org> | 2008-01-15 13:48:57 +0000 |
commit | 07a1957516495a89e68baefd808f9db4eea03cd5 (patch) | |
tree | f8d01a4fc091a809003891061d21cc28bd1f62f8 /src/alarm.c | |
parent | f299e48a40c6bd214783148273315e19e3de00b1 (diff) | |
download | conntrack-tools-07a1957516495a89e68baefd808f9db4eea03cd5.tar.gz conntrack-tools-07a1957516495a89e68baefd808f9db4eea03cd5.zip |
Max Kellermann <max@duempel.org>:
use timeradd() since manipulating tv_sec directly
Diffstat (limited to 'src/alarm.c')
-rw-r--r-- | src/alarm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/alarm.c b/src/alarm.c index 6edf68e..16e7a14 100644 --- a/src/alarm.c +++ b/src/alarm.c @@ -54,7 +54,7 @@ void add_alarm(struct alarm_list *alarm) struct timeval tv; gettimeofday(&tv, NULL); - alarm->tv.tv_sec += tv.tv_sec; + timeradd(&alarm->tv, &tv, &alarm->tv); __add_alarm(alarm); } @@ -68,9 +68,9 @@ void mod_alarm(struct alarm_list *alarm, unsigned long sc, unsigned long usc) struct timeval tv; list_del(&alarm->head); + set_alarm_expiration(alarm, sc, usc); gettimeofday(&tv, NULL); - alarm->tv.tv_sec = tv.tv_sec + sc; - alarm->tv.tv_usec = usc; + timeradd(&alarm->tv, &tv, &alarm->tv); __add_alarm(alarm); } |