aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorVenkatesh Srinivas <[email protected]>2011-08-07 12:18:05 -0400
committerJeff Garzik <[email protected]>2011-08-10 22:36:20 -0400
commitec93a0e2197e8a84789c6c512cee90a66a11f82a (patch)
tree8a9d7cab5e68f6b9cc0795d9f8aa4f187bee3869 /src/net.cpp
parentDo-nothing MapPort() ifndef USE_UPNP. fixes #450 (diff)
downloaddiscoin-ec93a0e2197e8a84789c6c512cee90a66a11f82a.tar.xz
discoin-ec93a0e2197e8a84789c6c512cee90a66a11f82a.zip
Test for SO_NOSIGPIPE rather than assuming all BSDs support it.
Signed-off-by: Jeff Garzik <[email protected]>
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 37adc13e1..b52af24a5 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -98,7 +98,7 @@ bool ConnectSocket(const CAddress& addrConnect, SOCKET& hSocketRet, int nTimeout
SOCKET hSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (hSocket == INVALID_SOCKET)
return false;
-#ifdef BSD
+#ifdef SO_NOSIGPIPE
int set = 1;
setsockopt(hSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)&set, sizeof(int));
#endif
@@ -1584,7 +1584,7 @@ bool BindListenPort(string& strError)
return false;
}
-#ifdef BSD
+#ifdef SO_NOSIGPIPE
// Different way of disabling SIGPIPE on BSD
setsockopt(hListenSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)&nOne, sizeof(int));
#endif