summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/dll_init.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/dll_init.cc')
-rw-r--r--winsup/cygwin/dll_init.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc
index 99974944b..1b6072a47 100644
--- a/winsup/cygwin/dll_init.cc
+++ b/winsup/cygwin/dll_init.cc
@@ -181,7 +181,10 @@ void
dll_list::detach (void *retaddr)
{
dll *d;
- if (!myself)
+ /* 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 (!myself || in_forkee)
return;
guard (true);
if ((d = find (retaddr)))