mirror of
https://github.com/NixOS/nix
synced 2025-06-25 06:31:14 +02:00
allocate SimpleLogger before forking
(cherry picked from commit 4e95f662db
)
This commit is contained in:
parent
323e840d17
commit
9ba32a2981
1 changed files with 2 additions and 1 deletions
|
@ -202,6 +202,7 @@ static int childEntry(void * arg)
|
|||
|
||||
pid_t startProcess(std::function<void()> fun, const ProcessOptions & options)
|
||||
{
|
||||
auto newLogger = makeSimpleLogger();
|
||||
ChildWrapperFunction wrapper = [&] {
|
||||
if (!options.allowVfork) {
|
||||
/* Set a simple logger, while releasing (not destroying)
|
||||
|
@ -210,7 +211,7 @@ pid_t startProcess(std::function<void()> fun, const ProcessOptions & options)
|
|||
~ProgressBar() tries to join a thread that doesn't
|
||||
exist. */
|
||||
logger.release();
|
||||
logger = makeSimpleLogger();
|
||||
logger = std::move(newLogger);
|
||||
}
|
||||
try {
|
||||
#ifdef __linux__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue