1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-23 04:54:26 +00:00

0 is a valid return value for read so only break out if read returns -1.

This commit is contained in:
Con Kolivas 2012-08-17 16:48:02 +10:00
parent 9065c63f40
commit b688d911ea

View File

@ -252,7 +252,7 @@ _serial_read(int fd, char *buf, size_t bufsiz, char *eol)
ssize_t len, tlen = 0; ssize_t len, tlen = 0;
while (bufsiz) { while (bufsiz) {
len = read(fd, buf, eol ? 1 : bufsiz); len = read(fd, buf, eol ? 1 : bufsiz);
if (len < 1) if (unlikely(len == -1))
break; break;
tlen += len; tlen += len;
if (eol && *eol == buf[0]) if (eol && *eol == buf[0])