summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2021-01-09 04:15:58 +0100
committerGravatar Nikias Bassen2021-01-09 04:15:58 +0100
commit7021c1ae173abfa47c67d883e8eacad75986d2f2 (patch)
tree58320ce69e65639364f7b234e70b6431d1ab47e5
parentbf2e2ec054102286ad6ab272be42c21034c136ed (diff)
downloadusbmuxd-7021c1ae173abfa47c67d883e8eacad75986d2f2.tar.gz
usbmuxd-7021c1ae173abfa47c67d883e8eacad75986d2f2.tar.bz2
usb: Don't warn about old configuration descriptor if device is unconfigured
-rw-r--r--src/usb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/usb.c b/src/usb.c
index 571a822..e334707 100644
--- a/src/usb.c
+++ b/src/usb.c
@@ -429,7 +429,9 @@ static int usb_device_add(libusb_device* dev)
}
if (current_config != desired_config) {
struct libusb_config_descriptor *config;
- if((res = libusb_get_active_config_descriptor(dev, &config)) != 0) {
+ if (current_config == 0) {
+ usbmuxd_log(LL_DEBUG, "Device %d-%d is unconfigured", bus, address);
+ } else if ((res = libusb_get_active_config_descriptor(dev, &config)) != 0) {
usbmuxd_log(LL_NOTICE, "Could not get old configuration descriptor for device %d-%d: %s", bus, address, libusb_error_name(res));
} else {
for(j=0; j<config->bNumInterfaces; j++) {