Skip to content

Commit 629a47a

Browse files
Document FreeBSD quirk. Fix FreeBSD build.
1 parent 3f398d7 commit 629a47a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/init.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,8 @@ bool AppInitParameterInteraction()
961961
nMaxConnections = std::max(nUserMaxConnections, 0);
962962

963963
// Trim requested connection counts, to fit into system limitations
964-
nMaxConnections = std::max(std::min(nMaxConnections, FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS - MAX_ADDNODE_CONNECTIONS), 0);
964+
// <int> in std::min<int>(...) to work around FreeBSD compilation issue described in #2695
965+
nMaxConnections = std::max(std::min<int>(nMaxConnections, FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS - MAX_ADDNODE_CONNECTIONS), 0);
965966
nFD = RaiseFileDescriptorLimit(nMaxConnections + MIN_CORE_FILEDESCRIPTORS + MAX_ADDNODE_CONNECTIONS);
966967
if (nFD < MIN_CORE_FILEDESCRIPTORS)
967968
return InitError(_("Not enough file descriptors available."));

0 commit comments

Comments
 (0)