1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +02:00

Merge pull request #13101 from NixOS/mergify/bp/2.28-maintenance/pr-13100

allocate SimpleLogger before forking (backport #13100)
This commit is contained in:
Jörg Thalheim 2025-04-28 09:48:32 +02:00 committed by GitHub
commit 4d4a91ab8d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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__