mirror of
https://github.com/fluencelabs/redis
synced 2025-03-20 17:40:50 +00:00
fix unsigned int overflow in adjustOpenFilesLimit
This commit is contained in:
parent
b399288ff5
commit
a1a07225b3
@ -1570,9 +1570,9 @@ void adjustOpenFilesLimit(void) {
|
|||||||
if (bestlimit < oldlimit) bestlimit = oldlimit;
|
if (bestlimit < oldlimit) bestlimit = oldlimit;
|
||||||
|
|
||||||
if (bestlimit < maxfiles) {
|
if (bestlimit < maxfiles) {
|
||||||
int old_maxclients = server.maxclients;
|
unsigned int old_maxclients = server.maxclients;
|
||||||
server.maxclients = bestlimit-CONFIG_MIN_RESERVED_FDS;
|
server.maxclients = bestlimit-CONFIG_MIN_RESERVED_FDS; /* NOTICE: server.maxclients is unsigned */
|
||||||
if (server.maxclients < 1) {
|
if (bestlimit <= CONFIG_MIN_RESERVED_FDS) {
|
||||||
serverLog(LL_WARNING,"Your current 'ulimit -n' "
|
serverLog(LL_WARNING,"Your current 'ulimit -n' "
|
||||||
"of %llu is not enough for the server to start. "
|
"of %llu is not enough for the server to start. "
|
||||||
"Please increase your open file limit to at least "
|
"Please increase your open file limit to at least "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user