diff options
author | Martin Aumueller | 2008-08-03 14:26:32 +0200 |
---|---|---|
committer | Matt Colyer | 2008-08-04 22:53:44 -0700 |
commit | 9698bafc781befb151a2b485d16cb71321a18aa3 (patch) | |
tree | cafdfdfe491b15e8af27f7ad1124030366d458c8 /src/iphone.c | |
parent | 4750a54def486d7c2fb6a8de1a287fdad086a92d (diff) | |
download | libplist-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/iphone.c')
-rw-r--r-- | src/iphone.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/iphone.c b/src/iphone.c index 77b67c3..6833e4c 100644 --- a/src/iphone.c +++ b/src/iphone.c @@ -148,6 +148,8 @@ int send_to_phone(iPhone *phone, char *data, int datalen) { bytes = usb_bulk_write(phone->device, BULKOUT, data, datalen, 800); if (debug) printf("noooo...?\n"); if (bytes < datalen) { + if(debug && bytes < 0) + printf("send_to_iphone(): libusb gave me the error: %s\n", usb_strerror()); return -1; } else { return bytes; @@ -169,6 +171,11 @@ int recv_from_phone(iPhone *phone, char *data, int datalen) { if (!phone) return -1; int bytes = 0; bytes = usb_bulk_read(phone->device, BULKIN, data, datalen, 3500); + if(bytes < 0) + { + if(debug) printf("recv_from_iphone(): libusb gave me the error: %s\n", usb_strerror()); + return -1; + } return bytes; } |