mirror of
https://github.com/NixOS/nix
synced 2025-06-26 20:01:15 +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)
|
pid_t startProcess(std::function<void()> fun, const ProcessOptions & options)
|
||||||
{
|
{
|
||||||
ChildWrapperFunction wrapper = [&] {
|
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();
|
logger = makeSimpleLogger();
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
#if __linux__
|
#if __linux__
|
||||||
if (options.dieWithParent && prctl(PR_SET_PDEATHSIG, SIGKILL) == -1)
|
if (options.dieWithParent && prctl(PR_SET_PDEATHSIG, SIGKILL) == -1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue