Skip to content

Commit 177f930

Browse files
committed
Call Process::InitializeSpawnHelper() ASAP
refs #8196
1 parent 338d0aa commit 177f930

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/cli/daemoncommand.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "base/defer.hpp"
1212
#include "base/logger.hpp"
1313
#include "base/application.hpp"
14+
#include "base/process.hpp"
1415
#include "base/timer.hpp"
1516
#include "base/utility.hpp"
1617
#include "base/exception.hpp"
@@ -504,6 +505,14 @@ static pid_t StartUnixWorker(const std::vector<std::string>& configs, bool close
504505
_exit(EXIT_FAILURE);
505506
}
506507

508+
try {
509+
Process::InitializeSpawnHelper();
510+
} catch (const std::exception& ex) {
511+
Log(LogCritical, "cli")
512+
<< "Failed to initialize process spawn helper after forking (child): " << DiagnosticInformation(ex);
513+
_exit(EXIT_FAILURE);
514+
}
515+
507516
_exit(RunWorker(configs, closeConsoleLog, stderrFile));
508517
} catch (...) {
509518
_exit(EXIT_FAILURE);

0 commit comments

Comments
 (0)