mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 15:27:53 +00:00
Fake the libusb transfer timed out message if we force cancel it with our own async functions.
This commit is contained in:
parent
a6a9407067
commit
375095645e
@ -2242,9 +2242,11 @@ static int callback_wait(struct usb_transfer *ut, int *transferred, unsigned int
|
|||||||
if (ret) {
|
if (ret) {
|
||||||
libusb_cancel_transfer(ut->transfer);
|
libusb_cancel_transfer(ut->transfer);
|
||||||
pthread_cond_wait(&ut->cond, &ut->mutex);
|
pthread_cond_wait(&ut->cond, &ut->mutex);
|
||||||
}
|
/* Fake the timed out message since it's effectively that */
|
||||||
/* No need to sort out mutexes here since they won't be reused */
|
ret = LIBUSB_TRANSFER_TIMED_OUT;
|
||||||
|
} else
|
||||||
ret = ut->transfer->status;
|
ret = ut->transfer->status;
|
||||||
|
/* No need to sort out mutexes here since they won't be reused */
|
||||||
*transferred = ut->transfer->actual_length;
|
*transferred = ut->transfer->actual_length;
|
||||||
libusb_free_transfer(ut->transfer);
|
libusb_free_transfer(ut->transfer);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user