From 0debd22baaddfa678ec80cb19be7852504ab7deb Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 7 Mar 2013 11:44:00 +0000 Subject: Linux: Consume all events on a fd in one go * This fixes libusb_handle_events_timeout() only handling one event * Closes #6 --- libusb/os/linux_usbfs.c | 4 +++- libusb/version_nano.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libusb/os/linux_usbfs.c b/libusb/os/linux_usbfs.c index ce77229..99bbd07 100644 --- a/libusb/os/linux_usbfs.c +++ b/libusb/os/linux_usbfs.c @@ -2490,7 +2490,9 @@ static int op_handle_events(struct libusb_context *ctx, continue; } - r = reap_for_handle(handle); + do { + r = reap_for_handle(handle); + } while (r == 0); if (r == 1 || r == LIBUSB_ERROR_NO_DEVICE) continue; else if (r < 0) diff --git a/libusb/version_nano.h b/libusb/version_nano.h index ff18d50..3aad736 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 10623 +#define LIBUSB_NANO 10624 -- cgit v1.2.1