Browse Source

Make sure to get time of first response in avalon read loop.

Con Kolivas 13 years ago
parent
commit
65bee71c21
1 changed files with 2 additions and 2 deletions
  1. 2 2
      driver-avalon.c

+ 2 - 2
driver-avalon.c

@@ -221,13 +221,13 @@ static int avalon_gets(int fd, uint8_t *buf, int read_count,
 			ret = read(fd, buf, read_amount);
 			ret = read(fd, buf, read_amount);
 			if (unlikely(ret < 0))
 			if (unlikely(ret < 0))
 				return AVA_GETS_ERROR;
 				return AVA_GETS_ERROR;
-			if (ret >= read_amount)
-				return AVA_GETS_OK;
 			if (first) {
 			if (first) {
 				if (tv_finish)
 				if (tv_finish)
 					gettimeofday(tv_finish, NULL);
 					gettimeofday(tv_finish, NULL);
 				first = false;
 				first = false;
 			}
 			}
+			if (ret >= read_amount)
+				return AVA_GETS_OK;
 			buf += ret;
 			buf += ret;
 			read_amount -= ret;
 			read_amount -= ret;
 			continue;
 			continue;