From c2ee43b01e1030b325d6ae9fad63209ee7607999 Mon Sep 17 00:00:00 2001 From: Dennis Potter Date: Thu, 9 Aug 2018 14:31:31 +0200 Subject: [PATCH] Changed location of int ret declaration ret is not used in case of RDTSC. So when PERIODIC_TASK_IMPL was set to RDTSC, the code wouldn't compile --- lib/task.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/task.c b/lib/task.c index 6b6fbae3f..6ef118f36 100644 --- a/lib/task.c +++ b/lib/task.c @@ -150,9 +150,9 @@ static int time_lt(const struct timespec *lhs, const struct timespec *rhs) uint64_t task_wait(struct task *t) { uint64_t runs; - int ret; #if PERIODIC_TASK_IMPL == CLOCK_NANOSLEEP || PERIODIC_TASK_IMPL == NANOSLEEP + int ret; struct timespec now; #if PERIODIC_TASK_IMPL == CLOCK_NANOSLEEP @@ -180,6 +180,8 @@ uint64_t task_wait(struct task *t) for (runs = 0; time_lt(&t->next, &now); runs++) t->next = time_add(&t->next, &t->period); #elif PERIODIC_TASK_IMPL == TIMERFD + int ret; + ret = read(t->fd, &runs, sizeof(runs)); if (ret < 0) return 0;