mirror of
https://github.com/dashpay/dash.git
synced 2024-12-29 13:59:06 +01:00
Explictly cast calculation to int, to allow std::max to work.
This commit is contained in:
parent
40809aed65
commit
5251d4450c
@ -531,7 +531,7 @@ bool AppInit2(boost::thread_group& threadGroup)
|
||||
// Make sure enough file descriptors are available
|
||||
int nBind = std::max((int)mapArgs.count("-bind"), 1);
|
||||
nMaxConnections = GetArg("-maxconnections", 125);
|
||||
nMaxConnections = std::max(std::min(nMaxConnections, FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS), 0);
|
||||
nMaxConnections = std::max(std::min(nMaxConnections, (int)(FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS)), 0);
|
||||
int nFD = RaiseFileDescriptorLimit(nMaxConnections + MIN_CORE_FILEDESCRIPTORS);
|
||||
if (nFD < MIN_CORE_FILEDESCRIPTORS)
|
||||
return InitError(_("Not enough file descriptors available."));
|
||||
|
Loading…
Reference in New Issue
Block a user