HomeFreeBSD

libusb: Emit event after deregistering hotplug handler

Description

libusb: Emit event after deregistering hotplug handler

The original implementation did not emit an event when a hotplug handler
was deregistered. This omission causes issues for programs that follow
the best practices recommended by libusb—particularly those that use
libusb_hotplug_register_callback() or similar functions in a loop
while managing hotplug handlers dynamically.

Without emitting an event after deregistration, these programs can
become stuck waiting indefinitely for an event that will never come,
as the condition to break out of the wait loop is never satisfied.

See: https://github.com/libusb/libusb/blob/6c0ae1ab456da49e7805115e77ce0428ace4ea41/libusb/hotplug.c#L459

Reviewed by: bapt
Sponsored By: FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50170

Details

Provenance
aokblastAuthored on May 5 2025, 5:52 PM
emasteCommitted on May 8 2025, 6:20 PM
Reviewer
bapt
Differential Revision
D50170: libusb: emit event when deregister event
Parents
rG08f613e1d142: fts: Fix misindented line.
Branches
Unknown
Tags
Unknown