diff options
author | Vadim Mikhailov <mvp@users.noreply.github.com> | 2019-09-20 15:29:30 -0700 |
---|---|---|
committer | Vadim Mikhailov <mvp@users.noreply.github.com> | 2019-09-20 15:29:30 -0700 |
commit | 4818eddc0389e2bba34a8cbe3ca5c67a6ad4d5ab (patch) | |
tree | a433acb35c9f79ebd9f2fc0106bea6b54d65bbfc | |
parent | c9fa3c68a1b2c9790c731602b8bae2b513e80605 (diff) |
FreeBSD is using bNumDeviceCapabilities instead of bNumDeviceCaps
FreeBSD libusb is different from mainline libusb, and needs hacks here and there :-(
This resolves issue #175.
-rw-r--r-- | uhubctl.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -429,7 +429,11 @@ static int get_hub_info(struct libusb_device *dev, struct hub_info *info) rc = libusb_get_bos_descriptor(devh, &bos); if (rc == 0) { int cap; +#ifdef __FreeBSD__ + for (cap=0; cap < bos->bNumDeviceCapabilities; cap++) { +#else for (cap=0; cap < bos->bNumDeviceCaps; cap++) { +#endif if (bos->dev_capability[cap]->bDevCapabilityType == LIBUSB_BT_CONTAINER_ID) { struct libusb_container_id_descriptor *container_id; rc = libusb_get_container_id_descriptor(NULL, bos->dev_capability[cap], &container_id); |