summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--src/alarm.c6
2 files changed, 2 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 06ccb5b..2c3c50f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -60,6 +60,7 @@ o set the return type of the parse functions to "void"
o use the comma operator instead of curly braces
o add missing function prototypes
o merge several *_alarm() functions into init_alarm()
+o use add_alarm() in mod_alarm() to avoid code duplication
version 0.9.5 (2007/07/29)
------------------------------
diff --git a/src/alarm.c b/src/alarm.c
index 16e7a14..3467e7b 100644
--- a/src/alarm.c
+++ b/src/alarm.c
@@ -65,13 +65,9 @@ void del_alarm(struct alarm_list *alarm)
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);
- timeradd(&alarm->tv, &tv, &alarm->tv);
- __add_alarm(alarm);
+ add_alarm(alarm);
}
int get_next_alarm(struct timeval *tv, struct timeval *next_alarm)