/*
* Reimplementing _reap for context use and compatibiliy with libusb-0.12.
- * Returns false on error, true otherwise.
+ *
+ * Returns false on timeout or error, true if an event was handled
+ *
+ * If ok_to_block_p is false then handle already pending events and return
+ * immediately.
+ * If ok_to_block_p is true then call libusb_handle_events_timeout with default
+ * timeout value of 2 seconds, which returns on event arrival or timeout.
*/
bool
tv.tv_usec = 0;
}
+
if ((ret = libusb_handle_events_timeout(d_ctx, &tv)) < 0) {
- fprintf (stderr, "fusb::_reap libusb_handle_events()\n");
+ fprintf (stderr, "fusb::_reap libusb_handle_events() %i\n", ret);
return false;
}