1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

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
This commit is contained in:
Dennis Potter 2018-08-09 14:31:31 +02:00
parent e926b9b6c2
commit c2ee43b01e

View file

@ -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;