diff options
author | michael-west <michael.west@ettus.com> | 2015-07-29 16:55:38 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2015-08-05 13:07:16 -0700 |
commit | b08352f267730ea417ec345cd90833a6746a1114 (patch) | |
tree | e9f0c401c8dae070087e9989091449be8fbcf13a /host/lib/transport/libusb1_base.cpp | |
parent | bb62ab84fdad6f7cf18ea55d395dfbd7f11ed79d (diff) | |
download | uhd-b08352f267730ea417ec345cd90833a6746a1114.tar.gz uhd-b08352f267730ea417ec345cd90833a6746a1114.tar.bz2 uhd-b08352f267730ea417ec345cd90833a6746a1114.zip |
Fix for BUG 869: UHD: Unhandled exceptions during destruction of multi_usrp object cause application to terminate
- Prevented libusb_zero_copy_single from submitting transfers after libusb reports an error
- Made error messages in libusb_zero_copy and udp_zero_copy more descriptive
Diffstat (limited to 'host/lib/transport/libusb1_base.cpp')
-rw-r--r-- | host/lib/transport/libusb1_base.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/host/lib/transport/libusb1_base.cpp b/host/lib/transport/libusb1_base.cpp index 9635d34b0..f92117a9e 100644 --- a/host/lib/transport/libusb1_base.cpp +++ b/host/lib/transport/libusb1_base.cpp @@ -71,7 +71,18 @@ private: timeval tv; tv.tv_sec = 0; tv.tv_usec = 100000; - libusb_handle_events_timeout(context, &tv); + int ret = libusb_handle_events_timeout(context, &tv); + switch (ret) + { + case LIBUSB_SUCCESS: + case LIBUSB_ERROR_TIMEOUT: + break; + case LIBUSB_ERROR_NO_DEVICE: + throw uhd::io_error(libusb_strerror(LIBUSB_ERROR_NO_DEVICE)); + default: + UHD_MSG(error) << __FUNCTION__ << ": " << libusb_strerror((libusb_error)ret) << std::endl; + break; + } } }; |