Commit 11b11a9d authored by Bastien Nocera's avatar Bastien Nocera

lib: Fix get_next_timeout_expiry

If get_next_timeout_expiry() fails, and libusb_get_next_timeout()
has no timeouts or failed, fprint_timeout will not be set, and
we cannot compare it to libusb_timeout.

Exit early if both failed or have empty queues.
parent 9da69dfc
Pipeline #8418 passed with stage
in 3 minutes and 20 seconds
......@@ -381,7 +381,7 @@ API_EXPORTED int fp_get_next_timeout(struct timeval *tv)
/* if we have no pending timeouts and the same is true for libusb,
* indicate that we have no pending timouts */
if (r_fprint == 0 && r_libusb == 0)
if (r_fprint <= 0 && r_libusb <= 0)
return 0;
/* if fprint have no pending timeouts return libusb timeout */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment