Linux: Consume all events on a fd in one go
authorHans de Goede <hdegoede@redhat.com>
Thu, 7 Mar 2013 11:44:00 +0000 (11:44 +0000)
committerPete Batard <pete@akeo.ie>
Sun, 10 Mar 2013 03:05:05 +0000 (03:05 +0000)
* This fixes libusb_handle_events_timeout() only handling one event
* Closes #6

libusb/os/linux_usbfs.c
libusb/version_nano.h

index ce77229..99bbd07 100644 (file)
@@ -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)
index ff18d50..3aad736 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 10623
+#define LIBUSB_NANO 10624