mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 08:38:27 -05: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…
Reference in New Issue
Block a user