Fix return timeout of fp_get_next_timeout
On function fp_get_next_timeout if exist fprint timeout or libusb timeout the function return the smaller of they. But if one of that not exist and have a smaller value the function return a timeout that not exist.
This commit is contained in:
parent
aab031ce37
commit
3dd905d4e9
1 changed files with 8 additions and 0 deletions
|
@ -270,6 +270,14 @@ API_EXPORTED int fp_get_next_timeout(struct timeval *tv)
|
|||
if (r_fprint == 0 && r_libusb == 0)
|
||||
return 0;
|
||||
|
||||
/* if fprint have no pending timeouts return libusb timeout */
|
||||
else if (r_fprint == 0)
|
||||
*tv = libusb_timeout;
|
||||
|
||||
/* if libusb have no pending timeouts return fprint timeout */
|
||||
else if (r_libusb == 0)
|
||||
*tv = fprint_timeout;
|
||||
|
||||
/* otherwise return the smaller of the 2 timeouts */
|
||||
else if (timercmp(&fprint_timeout, &libusb_timeout, <))
|
||||
*tv = fprint_timeout;
|
||||
|
|
Loading…
Reference in a new issue