aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-12-14 17:03:03 -0800
committerJosh Blum <josh@joshknows.com>2011-12-14 17:03:03 -0800
commitf51b5f268b7c127266fe19a0dcb3e244034bcd10 (patch)
treed6ad22a2c243024e92f8083d65971491c53a1d58
parentf51ce21daea2396060a54d5551a12d90df443dd2 (diff)
downloaduhd-f51b5f268b7c127266fe19a0dcb3e244034bcd10.tar.gz
uhd-f51b5f268b7c127266fe19a0dcb3e244034bcd10.tar.bz2
uhd-f51b5f268b7c127266fe19a0dcb3e244034bcd10.zip
uhd: make use of TEMP_FAILURE_RETRY when select()
-rw-r--r--host/lib/transport/udp_common.hpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/host/lib/transport/udp_common.hpp b/host/lib/transport/udp_common.hpp
index 47775d9c4..bf4712613 100644
--- a/host/lib/transport/udp_common.hpp
+++ b/host/lib/transport/udp_common.hpp
@@ -44,8 +44,15 @@ namespace uhd{ namespace transport{
FD_ZERO(&rset);
FD_SET(sock_fd, &rset);
+ //http://www.gnu.org/s/hello/manual/libc/Interrupted-Primitives.html
+ //This macro is provided with gcc to properly deal with EINTR.
+ //If not provided, define an empty macro, assume that is OK
+ #ifndef TEMP_FAILURE_RETRY
+ #define TEMP_FAILURE_RETRY(x) (x)
+ #endif
+
//call select with timeout on receive socket
- return ::select(sock_fd+1, &rset, NULL, NULL, &tv) > 0;
+ return TEMP_FAILURE_RETRY(::select(sock_fd+1, &rset, NULL, NULL, &tv)) > 0;
}
}} //namespace uhd::transport