From 494394829de2a0aa96321103ad3734c3e8e5280e Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Tue, 22 Aug 2017 18:52:32 +0200 Subject: lib: Fix timeout value of flow_event_wait shm_flow_set_wait was called with a timeout even though flow_event_wait was called with timeout NULL. --- src/lib/dev.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/lib/dev.c') diff --git a/src/lib/dev.c b/src/lib/dev.c index 894a7bab..c21e621a 100644 --- a/src/lib/dev.c +++ b/src/lib/dev.c @@ -1289,8 +1289,9 @@ int flow_event_wait(struct flow_set * set, struct fqueue * fq, const struct timespec * timeout) { - ssize_t ret; - struct timespec abstime; + ssize_t ret; + struct timespec abstime; + struct timespec * t = NULL; if (set == NULL || fq == NULL) return -EINVAL; @@ -1303,13 +1304,14 @@ int flow_event_wait(struct flow_set * set, if (timeout != NULL) { clock_gettime(PTHREAD_COND_CLOCK, &abstime); ts_add(&abstime, timeout, &abstime); + t = &abstime; } if (set->np1_set) - ret = frcti_event_wait(set, fq, &abstime); + ret = frcti_event_wait(set, fq, t); else ret = shm_flow_set_wait(ai.fqset, set->idx, - fq->fqueue, &abstime); + fq->fqueue, t); if (ret == -ETIMEDOUT) { fq->fqsize = 0; -- cgit v1.2.3