aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2013-05-29 19:41:51 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2013-05-29 19:41:51 -0700
commitd315eb0a76bcb656d5791df7b9b84443fd60b7c5 (patch)
tree8c0d713a63b4df0cbda2d07255cbe2f7cad84a06 /src
parent09e437ba4e5cb7fcc53020c1ceb2451e0ff1606b (diff)
parent03f498080a813850e1a3addf2c555450aa5e65c1 (diff)
Merge pull request #2695 from robbak/init_cpp-explicit_cast
Explictly cast calculation to int, to allow std::min to work.
Diffstat (limited to 'src')
-rw-r--r--src/init.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 59bf32ecac..767d7525a6 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -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."));