summaryrefslogtreecommitdiffstats
path: root/src/usbmux.c
diff options
context:
space:
mode:
authorGravatar Martin Aumueller2008-08-03 14:26:32 +0200
committerGravatar Matt Colyer2008-08-04 22:53:44 -0700
commit9698bafc781befb151a2b485d16cb71321a18aa3 (patch)
treecafdfdfe491b15e8af27f7ad1124030366d458c8 /src/usbmux.c
parent4750a54def486d7c2fb6a8de1a287fdad086a92d (diff)
downloadlibplist-9698bafc781befb151a2b485d16cb71321a18aa3.tar.gz
libplist-9698bafc781befb151a2b485d16cb71321a18aa3.tar.bz2
Print libusb errors during usb_bulk_read/write.
Signed-off-by: Matt Colyer <matt@colyer.name>
Diffstat (limited to 'src/usbmux.c')
-rw-r--r--src/usbmux.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/usbmux.c b/src/usbmux.c
index 474b13e..bdeea09 100644
--- a/src/usbmux.c
+++ b/src/usbmux.c
@@ -112,7 +112,12 @@ void mux_close_connection(iPhone *phone, usbmux_tcp_header *connection) {
int bytes = 0;
bytes = usb_bulk_write(phone->device, BULKOUT, (char*)connection, sizeof(*connection), 800);
+ if(debug && bytes < 0)
+ printf("mux_close_connection(): when writing, libusb gave me the error: %s\n", usb_strerror());
+
bytes = usb_bulk_read(phone->device, BULKIN, (char*)connection, sizeof(*connection), 800);
+ if(debug && bytes < 0)
+ printf("get_iPhone(): when reading, libusb gave me the error: %s\n", usb_strerror());
free(connection);
}