am da5b2d67: am 99bb69c1: am f41ee3d5: Merge "74602: Fixes adb not seeing connected devices on Mac."
* commit 'da5b2d67faeb2a85f042cf5b23d9875ad3413183':
74602: Fixes adb not seeing connected devices on Mac.
diff --git a/adb/usb_osx.c b/adb/usb_osx.c
index 5efb23b..ee893f5 100644
--- a/adb/usb_osx.c
+++ b/adb/usb_osx.c
@@ -513,14 +513,18 @@
return -1;
}
- result =
- (*handle->interface)->ReadPipe(handle->interface,
- handle->bulkIn, buf, &numBytes);
+ result = (*handle->interface)->ReadPipe(handle->interface, handle->bulkIn, buf, &numBytes);
- if (0 == result)
+ if (kIOUSBPipeStalled == result) {
+ DBG(" Pipe stalled, clearing stall.\n");
+ (*handle->interface)->ClearPipeStall(handle->interface, handle->bulkIn);
+ result = (*handle->interface)->ReadPipe(handle->interface, handle->bulkIn, buf, &numBytes);
+ }
+
+ if (kIOReturnSuccess == result)
return 0;
else {
- DBG("ERR: usb_read failed with status %d\n", result);
+ DBG("ERR: usb_read failed with status %x\n", result);
}
return -1;