summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2009-05-23 13:15:05 +0200
committerGravatar Nikias Bassen2009-05-23 13:15:05 +0200
commite6de508029e3db03eb295b466d18f2ccf790902b (patch)
treea990dc268e94cf5c16f4ecedda96e30866af21b6
parentf6c4deed001629a408cca62cbf8e82bf303554db (diff)
downloadusbmuxd-e6de508029e3db03eb295b466d18f2ccf790902b.tar.gz
usbmuxd-e6de508029e3db03eb295b466d18f2ccf790902b.tar.bz2
Some debugging output for usb_open().
-rw-r--r--src/main.c11
-rw-r--r--src/usbmux.c3
2 files changed, 8 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index 7b4fa57..f377b82 100644
--- a/src/main.c
+++ b/src/main.c
@@ -690,13 +690,12 @@ static void *usbmuxd_client_init_thread(void *arg)
udev = usb_open(dev);
if (udev) {
usb_get_string_simple(udev,
- dev->descriptor.
- iSerialNumber,
- dev_info_rec.device.
- serial_number,
- sizeof(dev_info_rec.device.
- serial_number) + 1);
+ dev->descriptor.iSerialNumber,
+ dev_info_rec.device.serial_number,
+ sizeof(dev_info_rec.device.serial_number) + 1);
usb_close(udev);
+ } else {
+ logmsg(LOG_ERR, "%s[%x]: Error: usb_open(): %s\n", __func__, THREAD, usb_strerror());
}
//pthread_mutex_unlock(&usbmux_mutex);
}
diff --git a/src/usbmux.c b/src/usbmux.c
index e86e3bc..90aeb84 100644
--- a/src/usbmux.c
+++ b/src/usbmux.c
@@ -329,6 +329,9 @@ int usbmux_get_specific_device(int bus_n, int dev_n,
if (dev->devnum == dev_n) {
newdevice->__device = dev;
newdevice->usbdev = usb_open(newdevice->__device);
+ if (!newdevice->usbdev) {
+ fprintf(stderr, "%s: Error: usb_open(): %s\n", __func__, usb_strerror());
+ }
if (usbmux_config_usb_device(newdevice) == 0) {
goto found;
}