diff options
-rw-r--r-- | examples/xusb.c | 9 | ||||
-rw-r--r-- | libusb/version_nano.h | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/examples/xusb.c b/examples/xusb.c index 7c2abb9..441af01 100644 --- a/examples/xusb.c +++ b/examples/xusb.c @@ -470,12 +470,15 @@ static int test_mass_storage(libusb_device_handle *handle, uint8_t endpoint_in, BOMS_GET_MAX_LUN, 0, 0, &lun, 1, 1000); // Some devices send a STALL instead of the actual value. // In such cases we should set lun to 0. - if (r == 0) { + if (r == LIBUSB_ERROR_PIPE) { lun = 0; + printf(" Stalled, setting Max LUN to 0\n"); } else if (r < 0) { - perr(" Failed: %s", libusb_strerror((enum libusb_error)r)); + perr(" Failed.\n"); + return r; + } else { + printf(" Max LUN = %d\n", lun); } - printf(" Max LUN = %d\n", lun); // Send Inquiry printf("\nSending Inquiry:\n"); diff --git a/libusb/version_nano.h b/libusb/version_nano.h index 4ac20f3..e443da4 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 11783 +#define LIBUSB_NANO 11784 |