root/trunk/libusb-runloop.patch
| Revision 98, 1.4 kB (checked in by jps, 16 months ago) |
|---|
-
libusb/darwin.c
old new 189 189 return "invalid argument"; 190 190 case kIOReturnAborted: 191 191 return "transaction aborted"; 192 case kIOReturnNotResponding: 193 return "the device is not responding"; 192 194 default: 193 195 return "unknown error"; 194 196 } … … 207 209 case kIOUSBNoAsyncPortErr: 208 210 return ENXIO; 209 211 case kIOReturnExclusiveAccess: 212 case kIOReturnNotResponding: 210 213 return EBUSY; 211 214 case kIOUSBPipeStalled: 212 215 return LUSBDARWINSTALL; … … 838 841 839 842 if (result == kIOReturnSuccess) { 840 843 /* wait for write to complete */ 841 if (CFRunLoopRunInMode(kCFRunLoopDefaultMode, (timeout+999)/1000, true) == kCFRunLoopRunTimedOut) { 842 (*(device->interface))->AbortPipe(device->interface, pipeRef); 843 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, true); /* Pick up aborted callback */ 844 if (usb_debug) 845 fprintf(stderr, "usb_bulk_read: input timed out\n"); 846 } 844 CFRunLoopRun(); 847 845 } 848 846 849 847 CFRunLoopRemoveSource(CFRunLoopGetCurrent(), cfSource, kCFRunLoopDefaultMode); 850 848 851 849 /* Check the return code of both the write and completion functions. */ 852 if (result != kIOReturnSuccess || (rw_arg.result != kIOReturnSuccess && 853 rw_arg.result != kIOReturnAborted) ) { 850 if (result != kIOReturnSuccess || rw_arg.result != kIOReturnSuccess) { 854 851 int error_code; 855 852 char *error_str; 856 853
Note: See TracBrowser
for help on using the browser.
