On Thu, Mar 7, 2013 at 7:44 PM, Hans de Goede <hdego...@redhat.com> wrote:
> This fixes issue 6: "libusb_handle_events_timeout() only handles one event"
> https://github.com/libusbx/libusbx/issues/6
>
> Note: untested / POC!!

Just wondering how to test this. Is it possible that you
can provide a simple test program?

> Signed-off-by: Hans de Goede <hdego...@redhat.com>
> ---
>  libusb/os/linux_usbfs.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/libusb/os/linux_usbfs.c b/libusb/os/linux_usbfs.c
> index 97b3776..12708e7 100644
> --- a/libusb/os/linux_usbfs.c
> +++ b/libusb/os/linux_usbfs.c
> @@ -2523,7 +2523,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)
> --
> 1.8.1.4

The fix seems to be correct as per your analysis.
https://github.com/libusbx/libusbx/issues/6

Another thing is that we have not really checked if this is a Linux
only issue or it is also affecting Mac OS X and Windows.

BTW, initially this issue is linked to 1.0.13 release and was closed
by Pete. Once you reopen the issue, 1.0.13 popped up in the milestone
view as overdue. So I have removed this issue from the milestone.


-- 
Xiaofan

------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to