summaryrefslogtreecommitdiff
path: root/libusb/hotplug.c
diff options
context:
space:
mode:
authorMarkus Heidelberg <markus.heidelberg@web.de>2014-02-02 15:41:20 +0100
committerLudovic Rousseau <ludovic.rousseau+github@gmail.com>2014-02-02 15:51:07 +0100
commit93de199d8d60822fc42b1cbf8b920132cd8bbbc6 (patch)
tree0ed2def15b34267a2409b83745886788724cc6cc /libusb/hotplug.c
parent77212172a1ec1908cee76be5ac0e151eff1bb838 (diff)
downloadlibusb-93de199d8d60822fc42b1cbf8b920132cd8bbbc6.tar.gz
Documentation: fix hotplug example
* add a missing call to libusb_handle_events_completed() * add a missing argument to libusb_hotplug_deregister_callback()
Diffstat (limited to 'libusb/hotplug.c')
-rw-r--r--libusb/hotplug.c7
1 files changed, 6 insertions, 1 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 <stdio.h>
+#include <stdlib.h>
+#include <libusb.h>
+
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;