* dll_init.cc (dll_global_dtors): Avoid calling destructors during failing

fork().
This commit is contained in:
Christopher Faylor
2011-05-04 16:02:45 +00:00
parent 54e4df33a2
commit 3521d50480
2 changed files with 10 additions and 0 deletions

View File

@@ -37,6 +37,11 @@ static bool dll_global_dtors_recorded;
void
dll_global_dtors ()
{
/* Don't attempt to call destructors if we're still in fork processing
since that likely means fork is failing and everything will not have been
set up. */
if (in_forkee)
return;
int recorded = dll_global_dtors_recorded;
dll_global_dtors_recorded = false;
if (recorded && dlls.start.next)