aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorBehnam Sabaghi <behnamsabaghi@gmail.com>2019-06-29 13:54:50 +0430
committerMartin Braun <martin.braun@ettus.com>2019-07-18 08:41:45 -0700
commit13a2ab5c88de1ae3d5ef4ba33ba2504dc455a0ad (patch)
tree191e3053ee56f6d8df6824fbe5407d94d5d42028 /host
parentdbb201e7275ff6e63bac9a749db3ee2c4f1c6418 (diff)
downloaduhd-13a2ab5c88de1ae3d5ef4ba33ba2504dc455a0ad.tar.gz
uhd-13a2ab5c88de1ae3d5ef4ba33ba2504dc455a0ad.tar.bz2
uhd-13a2ab5c88de1ae3d5ef4ba33ba2504dc455a0ad.zip
transport: usb: Allow to cancel USB requests without throwing
Diffstat (limited to 'host')
-rw-r--r--host/lib/transport/libusb1_zero_copy.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/host/lib/transport/libusb1_zero_copy.cpp b/host/lib/transport/libusb1_zero_copy.cpp
index 5b03aa86f..f5693b198 100644
--- a/host/lib/transport/libusb1_zero_copy.cpp
+++ b/host/lib/transport/libusb1_zero_copy.cpp
@@ -1,6 +1,7 @@
//
// Copyright 2010-2013 Ettus Research LLC
// Copyright 2018 Ettus Research, a National Instruments Company
+// Copyright 2019 Ettus Research, a National Instruments Brand
//
// SPDX-License-Identifier: GPL-3.0-or-later
//
@@ -158,7 +159,8 @@ public:
UHD_INLINE typename buffer_type::sptr get_new(const double timeout)
{
if (wait_for_completion(timeout)) {
- if (result.status != LIBUSB_TRANSFER_COMPLETED)
+ if (result.status != LIBUSB_TRANSFER_COMPLETED
+ && result.status != LIBUSB_TRANSFER_CANCELLED)
throw uhd::io_error(str(boost::format("usb %s transfer status: %d")
% _name % libusb_error_name(result.status)));
result.completed = 0;