[101668] trunk/dports/science/uhd
michaelld at macports.org
michaelld at macports.org
Wed Jan 16 09:37:12 PST 2013
Revision: 101668
https://trac.macports.org/changeset/101668
Author: michaelld at macports.org
Date: 2013-01-16 09:37:12 -0800 (Wed, 16 Jan 2013)
Log Message:
-----------
uhd : add patch to fix UDP transport (both release and devel).
Modified Paths:
--------------
trunk/dports/science/uhd/Portfile
Added Paths:
-----------
trunk/dports/science/uhd/files/patch-host-lib-transport-udp_zero_copy.cpp.diff
Modified: trunk/dports/science/uhd/Portfile
===================================================================
--- trunk/dports/science/uhd/Portfile 2013-01-16 16:48:20 UTC (rev 101667)
+++ trunk/dports/science/uhd/Portfile 2013-01-16 17:37:12 UTC (rev 101668)
@@ -21,6 +21,7 @@
Provides the release version, which is typically updated every month or so.
version 003_005_000
+ revision 1
distname release_${version}
worksrcdir UHD-Mirror-${distname}
master_sites https://github.com/EttusResearch/UHD-Mirror/archive
@@ -42,6 +43,7 @@
set base_version 003_005_000
version ${base_version}_20130109
+ revision 1
fetch.type git
git.url https://github.com/EttusResearch/UHD-Mirror.git
git.branch a3b7a3f8498d5e32f5aaa1051401e8a57c92cb3d
@@ -53,6 +55,11 @@
depends_lib-append port:boost
+# temporary patch to fix a bug in UDP transport; will be fixed in
+# upcoming release.
+
+patchfiles-append patch-host-lib-transport-udp_zero_copy.cpp.diff
+
# do VPATH build
post-extract { file mkdir ${workpath}/build }
Added: trunk/dports/science/uhd/files/patch-host-lib-transport-udp_zero_copy.cpp.diff
===================================================================
--- trunk/dports/science/uhd/files/patch-host-lib-transport-udp_zero_copy.cpp.diff (rev 0)
+++ trunk/dports/science/uhd/files/patch-host-lib-transport-udp_zero_copy.cpp.diff 2013-01-16 17:37:12 UTC (rev 101668)
@@ -0,0 +1,38 @@
+--- host/lib/transport/udp_zero_copy.cpp
++++ host/lib/transport/udp_zero_copy.cpp
+@@ -1,5 +1,5 @@
+ //
+-// Copyright 2010-2012 Ettus Research LLC
++// Copyright 2010-2013 Ettus Research LLC
+ //
+ // This program is free software: you can redistribute it and/or modify
+ // it under the terms of the GNU General Public License as published by
+@@ -24,6 +24,7 @@
+ #include <uhd/utils/atomic.hpp>
+ #include <boost/format.hpp>
+ #include <boost/make_shared.hpp>
++#include <boost/thread/thread.hpp> //sleep
+ #include <vector>
+
+ using namespace uhd;
+@@ -112,7 +113,20 @@ public:
+ _mem(mem), _sock_fd(sock_fd), _frame_size(frame_size) { /*NOP*/ }
+
+ void release(void){
+- UHD_ASSERT_THROW(::send(_sock_fd, (const char *)_mem, size(), 0) == ssize_t(size()));
++ //Retry logic because send may fail with ENOBUFS.
++ //This is known to occur at least on some OSX systems.
++ //But it should be safe to always check for the error.
++ while (true)
++ {
++ const ssize_t ret = ::send(_sock_fd, (const char *)_mem, size(), 0);
++ if (ret == ssize_t(size())) break;
++ if (ret == -1 and errno == ENOBUFS)
++ {
++ boost::this_thread::sleep(boost::posix_time::microseconds(1));
++ continue; //try to send again
++ }
++ UHD_ASSERT_THROW(ret == ssize_t(size()));
++ }
+ _claimer.release();
+ }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130116/5a695932/attachment-0001.html>
More information about the macports-changes
mailing list