Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2011-05-04 20:02:45 +0400
committerChristopher Faylor <me@cgf.cx>2011-05-04 20:02:45 +0400
commit3521d504804b8c43c93ade54c67716308c0c7d03 (patch)
treed9eed25ee66b3267167bd738bb38aebde0a4d8ab /winsup
parent54e4df33a23064c542eacd7f7e3598935d9c3100 (diff)
* dll_init.cc (dll_global_dtors): Avoid calling destructors during failing
fork().
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/dll_init.cc5
2 files changed, 10 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index bf83619e4..2919c99b2 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2011-05-04 Christopher Faylor <me.cygwin2011@cgf.cx>
+
+ * dll_init.cc (dll_global_dtors): Avoid calling destructors during
+ failing fork().
+
2011-05-04 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h (class fhandler_base): Remove uninterruptible_io status
diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc
index 85f3bae3f..99974944b 100644
--- a/winsup/cygwin/dll_init.cc
+++ b/winsup/cygwin/dll_init.cc
@@ -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)