diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-30 18:40:23 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-03-30 18:40:23 +0200 |
commit | 342d63a45a8918e45ddcf6a0b82b2f593f4bde12 (patch) | |
tree | 0f8117faa5d5e9f8b50e6e2014d9922ee0b35d14 /src/queue.c | |
parent | 9ee88db0f8c03951b84cd266fb85f314e8852937 (diff) | |
download | fastd-342d63a45a8918e45ddcf6a0b82b2f593f4bde12.tar fastd-342d63a45a8918e45ddcf6a0b82b2f593f4bde12.zip |
Limit key validity
Diffstat (limited to 'src/queue.c')
-rw-r--r-- | src/queue.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/queue.c b/src/queue.c index a2ef3dc..2509538 100644 --- a/src/queue.c +++ b/src/queue.c @@ -30,11 +30,6 @@ #include <stdint.h> -static inline bool after(const struct timespec *tp1, const struct timespec *tp2) { - return (tp1->tv_sec > tp2->tv_sec || - (tp1->tv_sec == tp2->tv_sec && tp1->tv_nsec > tp2->tv_nsec)); -} - void fastd_queue_put(fastd_context *ctx, fastd_queue *queue, fastd_queue_entry *entry, int timeout) { entry->timeout = ctx->now; @@ -50,7 +45,7 @@ void fastd_queue_put(fastd_context *ctx, fastd_queue *queue, fastd_queue_entry * fastd_queue_entry **current; for (current = &queue->head;; current = &(*current)->next) { - if (!(*current) || after(&(*current)->timeout, &entry->timeout)) { + if (!(*current) || timespec_after(&(*current)->timeout, &entry->timeout)) { entry->next = *current; *current = entry; break; |