Try to fetch events from nlsysevent or devd to determine when
to scan the usb bus for devices addition or removal.
if none are available fallback on the regular timer based (4s)
scanner
Details
Details
- Reviewers
emaste kevans - Group Reviewers
USB - Commits
- rG9dc96d8bc3f2: libusb: hotplug, use events instead of a timer when possible
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 61478 Build 58362: arc lint + arc unit
Event Timeline
Comment Actions
Looks fine in principle
lib/libusb/libusb10_hotplug.c | ||
---|---|---|
178–179 | This doesn't seem like it would work? | |
194 | IMO "ignore any error" should just be a (void) cast for the return vaule, but I don't feel strongly about it. | |
194 | Where is timeout coming from here? With this and the above, kinda seems like something went wrong with the patch. |
lib/libusb/libusb10_hotplug.c | ||
---|---|---|
194 | Yeah not a huge issue but I agree (void)poll(...) is both a programmer-readable and machine-readable way to indicate that errors are intentionally ignored. |
Comment Actions
actually read the informations bassed in the sockets to avoid poll looping forever
on libusb_exit close the sockets if any to provide immediate shutdown on the hotplug thread.
fallback on the timer based method when something goes wrong