2013-12-20 Markus Heidelberg <markus.heidelb...@web.de>:
> Also add #include directives since this is a complete program including
> main().
> ---
>
> I'm not sure about the #include directives. If not desired, they can be
> discarded along with the corresponding sentence in the patch description.
>
>  libusb/hotplug.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/libusb/hotplug.c b/libusb/hotplug.c
> index 081bc79..e86c1cb 100644
> --- a/libusb/hotplug.c
> +++ b/libusb/hotplug.c
> @@ -86,6 +86,11 @@
>   *
>   * The following code provides an example of the usage of the hotplug 
> interface:
>  \code
> +#include <libusb.h>
> +#include <stdlib.h>
> +#include <stdio.h>
> +#include <unistd.h>
> +
>  static int count = 0;
>
>  int hotplug_callback(struct libusb_context *ctx, struct libusb_device *dev,
> @@ -131,10 +136,11 @@ int main (void) {
>    }
>
>    while (count < 2) {
> +    libusb_handle_events_completed(NULL, NULL);
>      usleep(10000);
>    }
>
> -  libusb_hotplug_deregister_callback(handle);
> +  libusb_hotplug_deregister_callback(NULL, handle);
>    libusb_exit(NULL);
>
>    return 0;
> --
> 1.8.5.2

Patch applied in
https://github.com/libusb/libusb/commit/93de199d8d60822fc42b1cbf8b920132cd8bbbc6

Thanks

-- 
 Dr. Ludovic Rousseau

------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to