summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/dev.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/dev.c b/src/lib/dev.c
index c62fea40..eefb9b18 100644
--- a/src/lib/dev.c
+++ b/src/lib/dev.c
@@ -919,13 +919,12 @@ ssize_t flow_read(int fd, void * buf, size_t count)
pthread_rwlock_rdlock(&ai.data_lock);
}
- if (idx == -ETIMEDOUT) {
+ if (idx < 0) {
+ assert(idx == -EAGAIN || idx == -ETIMEDOUT);
pthread_rwlock_unlock(&ai.data_lock);
- return -ETIMEDOUT;
+ return idx;
}
- assert(idx >= 0);
-
n = shm_rdrbuff_read(&sdu, ai.rdrb, idx);
if (n < 0) {
pthread_rwlock_unlock(&ai.data_lock);