mirror of
https://github.com/NixOS/nix
synced 2025-06-25 06:31:14 +02:00
Fix crash on macOS
This commit is contained in:
parent
2018413e3e
commit
b576e6254a
1 changed files with 8 additions and 1 deletions
|
@ -200,8 +200,15 @@ static int childEntry(void * arg)
|
|||
pid_t startProcess(std::function<void()> fun, const ProcessOptions & options)
|
||||
{
|
||||
ChildWrapperFunction wrapper = [&] {
|
||||
if (!options.allowVfork)
|
||||
if (!options.allowVfork) {
|
||||
/* Set a simple logger, while releasing (not destroying)
|
||||
the parent logger. We don't want to run the parent
|
||||
logger's destructor since that will crash (e.g. when
|
||||
~ProgressBar() tries to join a thread that doesn't
|
||||
exist. */
|
||||
logger.release();
|
||||
logger = makeSimpleLogger();
|
||||
}
|
||||
try {
|
||||
#if __linux__
|
||||
if (options.dieWithParent && prctl(PR_SET_PDEATHSIG, SIGKILL) == -1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue