aboutsummaryrefslogtreecommitdiffstats
path: root/libusb/io.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-09-12 02:03:47 +0100
committerPete Batard <pete@akeo.ie>2012-09-13 00:46:40 +0100
commit00a3cf9630d8376ba0c1351d30da06dc9a5f8660 (patch)
tree7f88bfc133f066d2d480984c4de9b8d6cde97853 /libusb/io.c
parentc55ff2e00c2d0f893157347e8b6efb7eac335af3 (diff)
downloadandroid_external_libusbx-00a3cf9630d8376ba0c1351d30da06dc9a5f8660.tar.gz
android_external_libusbx-00a3cf9630d8376ba0c1351d30da06dc9a5f8660.tar.bz2
android_external_libusbx-00a3cf9630d8376ba0c1351d30da06dc9a5f8660.zip
All: Avoid polluting errors reported on device disconnect
* Makes libusb_cancel_transfer not log an error when the cancel fails with LIBUSB_ERROR_NO_DEVICE, so that apps can properly clean things up on device disconnect without flooding the console with these errors. * Also, some devices (Cypress FX) may switch VID:PID on the fly during firmware upload => reduce severity of the Windows message when that happens.
Diffstat (limited to 'libusb/io.c')
-rw-r--r--libusb/io.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libusb/io.c b/libusb/io.c
index 8a8bc67..1338981 100644
--- a/libusb/io.c
+++ b/libusb/io.c
@@ -1417,7 +1417,8 @@ int API_EXPORTED libusb_cancel_transfer(struct libusb_transfer *transfer)
usbi_mutex_lock(&itransfer->lock);
r = usbi_backend->cancel_transfer(itransfer);
if (r < 0) {
- if (r != LIBUSB_ERROR_NOT_FOUND)
+ if (r != LIBUSB_ERROR_NOT_FOUND &&
+ r != LIBUSB_ERROR_NO_DEVICE)
usbi_err(TRANSFER_CTX(transfer),
"cancel transfer failed error %d", r);
else