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:
parent
9065c63f40
commit
b688d911ea
@ -252,7 +252,7 @@ _serial_read(int fd, char *buf, size_t bufsiz, char *eol)
|
||||
ssize_t len, tlen = 0;
|
||||
while (bufsiz) {
|
||||
len = read(fd, buf, eol ? 1 : bufsiz);
|
||||
if (len < 1)
|
||||
if (unlikely(len == -1))
|
||||
break;
|
||||
tlen += len;
|
||||
if (eol && *eol == buf[0])
|
||||
|
Loading…
x
Reference in New Issue
Block a user