From 9698bafc781befb151a2b485d16cb71321a18aa3 Mon Sep 17 00:00:00 2001 From: Martin Aumueller Date: Sun, 3 Aug 2008 14:26:32 +0200 Subject: Print libusb errors during usb_bulk_read/write. Signed-off-by: Matt Colyer --- src/usbmux.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/usbmux.c') 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); } -- cgit v1.1-32-gdbae