From 310cd8d1bdd130d04c98e5e724b2af904fe94e2e Mon Sep 17 00:00:00 2001 From: Venkatesh Srinivas Date: Sun, 7 Aug 2011 12:18:05 -0400 Subject: [PATCH 1/3] Test for SO_NOSIGPIPE rather than assuming all BSDs support it. --- src/net.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index d697788..9feeb43 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 @@ -1579,7 +1579,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 -- 1.7.5.4