Commit af6111fb555f195574120ec19439662d1eb3d740

Con Kolivas 2013-04-08T11:22:25

Use no timeout on further reads in avalon_gets

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/driver-avalon.c b/driver-avalon.c
index 4af8f9c..4596cde 100644
--- a/driver-avalon.c
+++ b/driver-avalon.c
@@ -215,7 +215,7 @@ static inline int avalon_gets(int fd, uint8_t *buf, struct thr_info *thr,
 		timeout.tv_sec = 0;
 		/* If we get a restart message, still check if there's
 		 * anything in the buffer waiting to be parsed */
-		if (unlikely(thr->work_restart))
+		if (unlikely(thr->work_restart || !first))
 			timeout.tv_usec = 0;
 		else
 			timeout.tv_usec = 100000;