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
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
libusbx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libusbx-devel