Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
a1a07225
Commit
a1a07225
authored
Nov 10, 2016
by
oranagra
Browse files
fix unsigned int overflow in adjustOpenFilesLimit
parent
b399288f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/server.c
View file @
a1a07225
...
@@ -1570,9 +1570,9 @@ void adjustOpenFilesLimit(void) {
...
@@ -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 "
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment