From 6e02c24cfcba575c1e97a83fe59bea456eebf1ce Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 3 Aug 2015 18:07:12 -0700 Subject: [PATCH] Include the error code if GetPipeProperties fails. Bug: http://b/22829602 Change-Id: I90a89e70518053a4581e1862a7dbd5d09e06dadc --- adb/usb_osx.cpp | 6 +++++- fastboot/usb_osx.cpp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/adb/usb_osx.cpp b/adb/usb_osx.cpp index af6513093..939f319ab 100644 --- a/adb/usb_osx.cpp +++ b/adb/usb_osx.cpp @@ -34,6 +34,10 @@ #define DBG D +// There's no strerror equivalent for the errors returned by IOKit. +// https://developer.apple.com/library/mac/documentation/DeviceDrivers/Conceptual/AccessingHardware/AH_Handling_Errors/AH_Handling_Errors.html +// Search the web for "IOReturn.h" to find a complete up to date list. + static IONotificationPortRef notificationPort = 0; static io_iterator_t notificationIterator; @@ -362,7 +366,7 @@ CheckInterface(IOUSBInterfaceInterface **interface, UInt16 vendor, UInt16 produc handle->zero_mask = maxPacketSize - 1; } else { - DBG("ERR: FindDeviceInterface - could not get pipe properties\n"); + DBG("ERR: FindDeviceInterface - could not get pipe properties (%08x)\n", kr); goto err_get_pipe_props; } } diff --git a/fastboot/usb_osx.cpp b/fastboot/usb_osx.cpp index a959566e0..1c7eff061 100644 --- a/fastboot/usb_osx.cpp +++ b/fastboot/usb_osx.cpp @@ -210,7 +210,7 @@ static int try_interfaces(IOUSBDeviceInterface182 **dev, usb_handle *handle) { handle->zero_mask = maxPacketSize - 1; } } else { - ERR("could not get pipe properties\n"); + ERR("could not get pipe properties (%08x)\n", kr); } if (handle->info.has_bulk_in && handle->info.has_bulk_out) {