summaryrefslogtreecommitdiff
path: root/usrp
diff options
context:
space:
mode:
authorThomas Tsou2009-11-02 16:53:29 -0500
committerThomas Tsou2009-11-02 17:09:00 -0500
commit097191b3a89c09a492f322eac539eb5db8668843 (patch)
tree374dc6135dd57d71489c1082a7f21d1b549606a7 /usrp
parent1530b6153fe21bf8c77f76c5d854108dd47069f6 (diff)
downloadgnuradio-097191b3a89c09a492f322eac539eb5db8668843.tar.gz
gnuradio-097191b3a89c09a492f322eac539eb5db8668843.tar.bz2
gnuradio-097191b3a89c09a492f322eac539eb5db8668843.zip
usrp: Check return value in fusb_libusb1 _reap()
The old fusb_libusb1 _reap() call always returned true except on error. With this commit it checks that a transfer is actually reaped and returns false otherwise.
Diffstat (limited to 'usrp')
-rw-r--r--usrp/host/lib/fusb_libusb1.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/usrp/host/lib/fusb_libusb1.cc b/usrp/host/lib/fusb_libusb1.cc
index 4846f51a5..770708451 100644
--- a/usrp/host/lib/fusb_libusb1.cc
+++ b/usrp/host/lib/fusb_libusb1.cc
@@ -279,6 +279,9 @@ fusb_devhandle_libusb1::_reap (bool ok_to_block_p)
int ret;
struct timeval tv;
+ // Save pending size
+ int pnd_size = d_pending_rqsts.size();
+
if (ok_to_block_p) {
tv.tv_sec = 2;
tv.tv_usec = 0;
@@ -293,7 +296,12 @@ fusb_devhandle_libusb1::_reap (bool ok_to_block_p)
return false;
}
- return true;
+ // Check that a pending transfer was removed
+ if (pnd_size > d_pending_rqsts.size())
+ return true;
+ else {
+ return false;
+ }
}
void