summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-02-28 00:22:53 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-02-28 00:22:53 +0100
commitc0f7708f4a36074817556d0966aeb54cc64a5b88 (patch)
tree0df79e295658cd740c29bc6959ade1b20add6653
parent6c2649ab27f96dcc40a1f01a36a07d1603f39c51 (diff)
downloadfastd-c0f7708f4a36074817556d0966aeb54cc64a5b88.tar
fastd-c0f7708f4a36074817556d0966aeb54cc64a5b88.zip
Fix sign in queue timeout calculation
-rw-r--r--src/queue.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/queue.c b/src/queue.c
index 79f4e96..87ca255 100644
--- a/src/queue.c
+++ b/src/queue.c
@@ -81,7 +81,7 @@ int fastd_queue_timeout(fastd_queue *queue) {
struct timespec tp;
clock_gettime(CLOCK_MONOTONIC, &tp);
- int64_t diff_msec = ((int64_t)(queue->head->timeout.tv_sec-tp.tv_sec))*1000 - (queue->head->timeout.tv_nsec-tp.tv_nsec)/1e6;
+ int64_t diff_msec = ((int64_t)(queue->head->timeout.tv_sec-tp.tv_sec))*1000 + (queue->head->timeout.tv_nsec-tp.tv_nsec)/1e6;
if (diff_msec < 0)
return 0;
else