TerminateModuleForkChild(): move safety checks there.

We don't want that the API could be used directly in an unsafe way,
without checking if there is an active child. Now the safety checks are
moved directly in the function performing the operations.
This commit is contained in:
antirez
2019-09-27 12:17:47 +02:00
parent de1f82aa33
commit 721d3c9e0c
3 changed files with 20 additions and 19 deletions

View File

@ -3589,7 +3589,7 @@ int prepareForShutdown(int flags) {
/* Kill module child if there is one. */
if (server.module_child_pid != -1) {
serverLog(LL_WARNING,"There is a module fork child. Killing it!");
TerminateModuleForkChild(0);
TerminateModuleForkChild(server.module_child_pid,0);
}
if (server.aof_state != AOF_OFF) {