summaryrefslogtreecommitdiff
path: root/libusb/hotplug.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-08-21 14:30:51 +0200
committerHans de Goede <hdegoede@redhat.com>2013-08-21 14:30:51 +0200
commit0fc304da83595da9830bf368f66312ffd793f10c (patch)
treeddc7964b8d9c0ea25f7ab1145349de11e14bda0a /libusb/hotplug.c
parentbe76bef5b716d27b78fba120d3f9b815ed3380b9 (diff)
downloadlibusb-0fc304da83595da9830bf368f66312ffd793f10c.tar.gz
hotplug: Document that callbacks cannot unregister themselves when called from hotplug_register_callback
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'libusb/hotplug.c')
-rw-r--r--libusb/hotplug.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libusb/hotplug.c b/libusb/hotplug.c
index 16725f2..2465f6e 100644
--- a/libusb/hotplug.c
+++ b/libusb/hotplug.c
@@ -59,7 +59,11 @@
*
* A callback function must return an int (0 or 1) indicating whether the callback is
* expecting additional events. Returning 0 will rearm the callback and 1 will cause
- * the callback to be deregistered.
+ * the callback to be deregistered. Note that when callbacks are called from
+ * libusb_hotplug_register_callback() because of the \ref LIBUSB_HOTPLUG_ENUMERATE
+ * flag, the callback return value is ignored, iow you cannot cause a callback
+ * to be deregistered by returning 1 when it is called from
+ * libusb_hotplug_register_callback().
*
* Callbacks for a particular context are automatically deregistered by libusb_exit().
*