File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -952,8 +952,13 @@ bool AppInitParameterInteraction()
952
952
953
953
// Trim requested connection counts, to fit into system limitations
954
954
// <int> in std::min<int>(...) to work around FreeBSD compilation issue described in #2695
955
- nMaxConnections = std::max (std::min<int >(nMaxConnections, FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS - MAX_ADDNODE_CONNECTIONS), 0 );
956
955
nFD = RaiseFileDescriptorLimit (nMaxConnections + MIN_CORE_FILEDESCRIPTORS + MAX_ADDNODE_CONNECTIONS);
956
+ #ifdef USE_POLL
957
+ int fd_max = nFD;
958
+ #else
959
+ int fd_max = FD_SETSIZE;
960
+ #endif
961
+ nMaxConnections = std::max (std::min<int >(nMaxConnections, fd_max - nBind - MIN_CORE_FILEDESCRIPTORS - MAX_ADDNODE_CONNECTIONS), 0 );
957
962
if (nFD < MIN_CORE_FILEDESCRIPTORS)
958
963
return InitError (_ (" Not enough file descriptors available." ));
959
964
nMaxConnections = std::min (nFD - MIN_CORE_FILEDESCRIPTORS - MAX_ADDNODE_CONNECTIONS, nMaxConnections);
You can’t perform that action at this time.
0 commit comments