mirror of
https://github.com/RPCS3/libusb.git
synced 2024-11-23 18:19:40 +00:00
io: Clear transfer timeout struct when transfer has no timeout
Prior to this commit, a transfer that was submitted with a non-zero timeout would retain this timeout if the transfer was resubmitted with a zero (unlimited) timeout. This commit corrects this by clearing the transfer's timeout if the desired timeout is zero. Closes #332 Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
This commit is contained in:
parent
1fe3db7919
commit
2cefbc80f2
@ -1205,8 +1205,10 @@ static int calculate_timeout(struct usbi_transfer *transfer)
|
||||
unsigned int timeout =
|
||||
USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer)->timeout;
|
||||
|
||||
if (!timeout)
|
||||
if (!timeout) {
|
||||
timerclear(&transfer->timeout);
|
||||
return 0;
|
||||
}
|
||||
|
||||
r = usbi_backend.clock_gettime(USBI_CLOCK_MONOTONIC, ¤t_time);
|
||||
if (r < 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user