diff options
Diffstat (limited to 'src/iphone.c')
| -rw-r--r-- | src/iphone.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/iphone.c b/src/iphone.c index 426b629..558dd9a 100644 --- a/src/iphone.c +++ b/src/iphone.c | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | 21 | ||
| 22 | #include "usbmux.h" | 22 | #include "usbmux.h" |
| 23 | #include "iphone.h" | 23 | #include "iphone.h" |
| 24 | #include <arpa/inet.h> | ||
| 24 | #include <usb.h> | 25 | #include <usb.h> |
| 25 | #include <stdio.h> | 26 | #include <stdio.h> |
| 26 | #include <stdlib.h> | 27 | #include <stdlib.h> |
| @@ -141,13 +142,13 @@ int send_to_phone(iPhone *phone, char *data, int datalen) { | |||
| 141 | if (!phone) return -1; | 142 | if (!phone) return -1; |
| 142 | int bytes = 0; | 143 | int bytes = 0; |
| 143 | // it may die here | 144 | // it may die here |
| 144 | if (debug) printf("dying here?\ndatalen = %i\ndata = %x\n", datalen, data); | 145 | if (debug) printf("dying here?\ndatalen = %i\ndata = %p\n", datalen, data); |
| 145 | 146 | ||
| 146 | bytes = usb_bulk_write(phone->device, BULKOUT, data, datalen, 800); | 147 | bytes = usb_bulk_write(phone->device, BULKOUT, data, datalen, 800); |
| 147 | if (debug) printf("noooo...?\n"); | 148 | if (debug) printf("noooo...?\n"); |
| 148 | if (bytes < datalen) { | 149 | if (bytes < datalen) { |
| 149 | if(debug && bytes < 0) | 150 | if(debug && bytes < 0) |
| 150 | printf("send_to_iphone(): libusb gave me the error %d: %s\n", bytes, usb_strerror(), strerror(-bytes)); | 151 | printf("send_to_iphone(): libusb gave me the error %d: %s - %s\n", bytes, usb_strerror(), strerror(-bytes)); |
| 151 | return -1; | 152 | return -1; |
| 152 | } else { | 153 | } else { |
| 153 | return bytes; | 154 | return bytes; |
