From: Venkatesh Srinivas Date: Sun, 7 Aug 2011 16:18:05 +0000 (-0400) Subject: Test for SO_NOSIGPIPE rather than assuming all BSDs support it. X-Git-Tag: v0.4.0-unstable~227^2~54 X-Git-Url: https://git.novaco.in/?a=commitdiff_plain;h=ec93a0e2197e8a84789c6c512cee90a66a11f82a;p=novacoin.git Test for SO_NOSIGPIPE rather than assuming all BSDs support it. Signed-off-by: Jeff Garzik --- diff --git a/src/net.cpp b/src/net.cpp index 37adc13..b52af24 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