diff --git a/src/config.c b/src/config.c index ae60dd3fd0..4494da4e2e 100644 --- a/src/config.c +++ b/src/config.c @@ -2709,6 +2709,10 @@ static int setConfigDirOption(standardConfig *config, sds *argv, int argc, const *err = "dir can't be empty"; return 0; } + if (hasActiveChildProcess()) { + *err = "it is unsafe to modify dir when a child process is running"; + return 0; + } if (chdir(argv[0]) == -1) { *err = strerror(errno); return 0;