Merge "fastboot: gracefully handle failure to open a USB device on OS X." am: 11be3e54bd
am: 9a1e060dc6
Change-Id: I4cef93d371b3327d063a6a16eb6ae7f6a64f740d
diff --git a/fastboot/usb_osx.cpp b/fastboot/usb_osx.cpp
index 9069baa..e95b049 100644
--- a/fastboot/usb_osx.cpp
+++ b/fastboot/usb_osx.cpp
@@ -93,12 +93,9 @@
SInt32 score;
UInt8 interfaceNumEndpoints;
- // Placing the constant KIOUSBFindInterfaceDontCare into the following
- // fields of the IOUSBFindInterfaceRequest structure will allow us to
- // find all of the interfaces
- request.bInterfaceClass = kIOUSBFindInterfaceDontCare;
- request.bInterfaceSubClass = kIOUSBFindInterfaceDontCare;
- request.bInterfaceProtocol = kIOUSBFindInterfaceDontCare;
+ request.bInterfaceClass = 0xff;
+ request.bInterfaceSubClass = 0x42;
+ request.bInterfaceProtocol = 0x03;
request.bAlternateSetting = kIOUSBFindInterfaceDontCare;
// Get an iterator for the interfaces on the device
@@ -282,7 +279,6 @@
&plugin, &score);
if ((kr != 0) || (plugin == NULL)) {
- ERR("Unable to create a plug-in (%08x)\n", kr);
goto error;
}
@@ -436,8 +432,7 @@
if (try_device(device, &h) != 0) {
IOObjectRelease(device);
- ret = -1;
- break;
+ continue;
}
if (h.success) {