From c754ae294cfe96ec4738d6641137c9e6c56330c7 Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Sat, 17 Jan 2009 00:25:40 +0000 Subject: [PATCH] Decrement poll() result when internal pipe has been handled When we receive data on the internal control pipe, we need to correctly decrement the number of ready file descriptors before passing on the remaining work to the OS implementation. --- libusb/io.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libusb/io.c b/libusb/io.c index 320bc4b..b053f85 100644 --- a/libusb/io.c +++ b/libusb/io.c @@ -1587,6 +1587,7 @@ static int handle_events(struct libusb_context *ctx, struct timeval *tv) } else { /* prevent OS backend from trying to handle events on ctrl pipe */ fds[0].revents = 0; + r--; } } -- 2.7.4