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
f9fac7f7
Commit
f9fac7f7
authored
Jul 05, 2017
by
antirez
Browse files
Avoid closing invalid FDs to make Valgrind happier.
parent
413c2bc1
Changes
1
Show whitespace changes
Inline
Side-by-side
src/server.c
View file @
f9fac7f7
...
...
@@ -1555,7 +1555,11 @@ int restartServer(int flags, mstime_t delay) {
/* Close all file descriptors, with the exception of stdin, stdout, strerr
* which are useful if we restart a Redis server which is not daemonized. */
for
(
j
=
3
;
j
<
(
int
)
server
.
maxclients
+
1024
;
j
++
)
close
(
j
);
for
(
j
=
3
;
j
<
(
int
)
server
.
maxclients
+
1024
;
j
++
)
{
/* Test the descriptor validity before closing it, otherwise
* Valgrind issues a warning on close(). */
if
(
fcntl
(
j
,
F_GETFD
)
!=
-
1
)
close
(
j
);
}
/* Execute the server with the original command line. */
if
(
delay
)
usleep
(
delay
*
1000
);
...
...
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