From 93de199d8d60822fc42b1cbf8b920132cd8bbbc6 Mon Sep 17 00:00:00 2001 From: Markus Heidelberg Date: Sun, 2 Feb 2014 15:41:20 +0100 Subject: [PATCH] Documentation: fix hotplug example * add a missing call to libusb_handle_events_completed() * add a missing argument to libusb_hotplug_deregister_callback() --- libusb/hotplug.c | 7 ++++++- libusb/version_nano.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libusb/hotplug.c b/libusb/hotplug.c index 7c6331a..eba8f98 100644 --- a/libusb/hotplug.c +++ b/libusb/hotplug.c @@ -86,6 +86,10 @@ * * The following code provides an example of the usage of the hotplug interface: \code +#include +#include +#include + static int count = 0; int hotplug_callback(struct libusb_context *ctx, struct libusb_device *dev, @@ -131,10 +135,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; diff --git a/libusb/version_nano.h b/libusb/version_nano.h index a1aac70..2132f37 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 10867 +#define LIBUSB_NANO 10868 -- 2.7.4