mirror of
https://github.com/GOSTSec/sgminer
synced 2025-03-13 06:01:03 +00:00
Check for zero timeout in usb read.
This commit is contained in:
parent
27628cdda9
commit
2887147444
@ -2114,6 +2114,8 @@ int _usb_read(struct cgpu_info *cgpu, int ep, char *buf, size_t bufsiz, int *pro
|
||||
* if we don't sleep here, but do it only if we're not
|
||||
* receiving any data. */
|
||||
timeout = initial_timeout - (done * 1000);
|
||||
if (!timeout)
|
||||
break;
|
||||
if (!got && sleep_time) {
|
||||
if (timeout <= sleep_time)
|
||||
sleep_time = timeout - 1;
|
||||
@ -2206,6 +2208,8 @@ int _usb_read(struct cgpu_info *cgpu, int ep, char *buf, size_t bufsiz, int *pro
|
||||
break;
|
||||
|
||||
timeout = initial_timeout - (done * 1000);
|
||||
if (!timeout)
|
||||
break;
|
||||
if (!got && sleep_time) {
|
||||
if (timeout <= sleep_time)
|
||||
sleep_time = timeout - 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user