From 0fc304da83595da9830bf368f66312ffd793f10c Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 21 Aug 2013 14:30:51 +0200 Subject: hotplug: Document that callbacks cannot unregister themselves when called from hotplug_register_callback Signed-off-by: Hans de Goede --- libusb/hotplug.c | 6 +++++- libusb/version_nano.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'libusb') 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(). * diff --git a/libusb/version_nano.h b/libusb/version_nano.h index 4972515..c265037 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 10814 +#define LIBUSB_NANO 10815 -- cgit v1.2.1