aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2018-06-19 15:39:52 +0200
committerpracticalswift <practicalswift@users.noreply.github.com>2018-06-21 09:27:24 +0200
commit629a47a1543a6e77cbf9c73917e2e419669b04df (patch)
treef461892cb3f2958666e8aaebd1f924ade3add079 /src/init.cpp
parent3f398d7a17f136cd4a67998406ca41a124ae2966 (diff)
downloadbitcoin-629a47a1543a6e77cbf9c73917e2e419669b04df.tar.xz
Document FreeBSD quirk. Fix FreeBSD build.
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 1b5507703c..d56bb73beb 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -961,7 +961,8 @@ bool AppInitParameterInteraction()
nMaxConnections = std::max(nUserMaxConnections, 0);
// Trim requested connection counts, to fit into system limitations
- nMaxConnections = std::max(std::min(nMaxConnections, FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS - MAX_ADDNODE_CONNECTIONS), 0);
+ // <int> in std::min<int>(...) to work around FreeBSD compilation issue described in #2695
+ nMaxConnections = std::max(std::min<int>(nMaxConnections, FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS - MAX_ADDNODE_CONNECTIONS), 0);
nFD = RaiseFileDescriptorLimit(nMaxConnections + MIN_CORE_FILEDESCRIPTORS + MAX_ADDNODE_CONNECTIONS);
if (nFD < MIN_CORE_FILEDESCRIPTORS)
return InitError(_("Not enough file descriptors available."));