diff options
author | MarcoFalke <falke.marco@gmail.com> | 2018-06-27 04:39:41 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2018-06-27 04:39:47 -0400 |
commit | c655b2c2df15ef2c9f8235dc92174f2db6521463 (patch) | |
tree | 9ac49edac0b29bb5927485c93197304a84ef07a5 /src | |
parent | 7209fec190b1247bf16ad9734b7369000cdc888e (diff) | |
parent | 629a47a1543a6e77cbf9c73917e2e419669b04df (diff) |
Merge #13503: Document FreeBSD quirk. Fix FreeBSD build: Use std::min<int>(...) to allow for compilation under certain FreeBSD versions.
629a47a154 Document FreeBSD quirk. Fix FreeBSD build. (practicalswift)
Pull request description:
* Document FreeBSD quirk.
* Fix FreeBSD build: Cast to `int` to allow `std::min` to work under FreeBSD.
Context: https://github.com/bitcoin/bitcoin/pull/9598#issuecomment-398353904
Tree-SHA512: 5ca7a5fa9e1f3efae241b9be64c9b019ec713c11dcc3edaaed383477ea48ac0dc82549ffebbe9069e8c3f6eff30acd6e4542b4aa31d307f022f4f51e5851a82c
Diffstat (limited to 'src')
-rw-r--r-- | src/init.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp index fe27dad4d6..5e45277986 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.")); |