Commit ec93a0e2 authored by Venkatesh Srinivas's avatar Venkatesh Srinivas Committed by Jeff Garzik
Browse files

Test for SO_NOSIGPIPE rather than assuming all BSDs support it.

Signed-off-by: default avatarJeff Garzik <jgarzik@exmulti.com>
parent 9f0ac169
Showing with 2 additions and 2 deletions
+2 -2
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment