diff options
-rw-r--r-- | include/alarm.h | 2 | ||||
-rw-r--r-- | src/alarm.c | 6 |
2 files changed, 1 insertions, 7 deletions
diff --git a/include/alarm.h b/include/alarm.h index 3569025..c4ea9d7 100644 --- a/include/alarm.h +++ b/include/alarm.h @@ -5,8 +5,6 @@ #include <sys/time.h> -extern int alarm_counter; - struct alarm_list { struct list_head head; struct timeval tv; diff --git a/src/alarm.c b/src/alarm.c index 883a42c..7352ccb 100644 --- a/src/alarm.c +++ b/src/alarm.c @@ -24,7 +24,6 @@ #define ALARM_HASH_SIZE 2048 static struct list_head *alarm_hash; -int alarm_counter; void init_alarm(struct alarm_list *t, void *data, @@ -62,16 +61,13 @@ void add_alarm(struct alarm_list *alarm, unsigned long sc, unsigned long usc) gettimeofday(&tv, NULL); timeradd(&alarm->tv, &tv, &alarm->tv); __add_alarm(alarm); - alarm_counter++; } void del_alarm(struct alarm_list *alarm) { /* don't remove a non-inserted node */ - if (!list_empty(&alarm->head)) { + if (!list_empty(&alarm->head)) list_del_init(&alarm->head); - alarm_counter--; - } } static struct timeval * |