Call Process::InitializeSpawnHelper() ASAP

refs #8196
This commit is contained in:
Alexander A. Klimov 2020-09-23 11:49:13 +02:00
parent 338d0aaa8c
commit 177f930375
1 changed files with 9 additions and 0 deletions

View File

@ -11,6 +11,7 @@
#include "base/defer.hpp"
#include "base/logger.hpp"
#include "base/application.hpp"
#include "base/process.hpp"
#include "base/timer.hpp"
#include "base/utility.hpp"
#include "base/exception.hpp"
@ -504,6 +505,14 @@ static pid_t StartUnixWorker(const std::vector<std::string>& configs, bool close
_exit(EXIT_FAILURE);
}
try {
Process::InitializeSpawnHelper();
} catch (const std::exception& ex) {
Log(LogCritical, "cli")
<< "Failed to initialize process spawn helper after forking (child): " << DiagnosticInformation(ex);
_exit(EXIT_FAILURE);
}
_exit(RunWorker(configs, closeConsoleLog, stderrFile));
} catch (...) {
_exit(EXIT_FAILURE);