From 629a47a1543a6e77cbf9c73917e2e419669b04df Mon Sep 17 00:00:00 2001 From: practicalswift Date: Tue, 19 Jun 2018 15:39:52 +0200 Subject: [PATCH] Document FreeBSD quirk. Fix FreeBSD build. --- src/init.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index 1b5507703..d56bb73be 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); + // in std::min(...) to work around FreeBSD compilation issue described in #2695 + nMaxConnections = std::max(std::min(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."));