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:
authorRobert Collins <rbtcollins@hotmail.com>2002-04-19 16:46:19 +0400
committerRobert Collins <rbtcollins@hotmail.com>2002-04-19 16:46:19 +0400
commit4ce4e69db68ce2155c9235ff718914059866d977 (patch)
treed513f83720b4bd971a4aea743d6315294d98e50f /winsup
parente9f1cbd0114a837679ca651f7332ab151f696cb8 (diff)
2002-04-16 Thomas Pfaff <tpfaff@gmx.net>
* dll_init.h (per_process::dtors_run): New member. * dll_init.cc (per_module::run_dtors): Run dtors only once. (dll::init): Initialize dtors_run flag.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/dll_init.cc7
-rw-r--r--winsup/cygwin/dll_init.h1
3 files changed, 14 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index de3ac037f..553bd3419 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+2002-04-16 Thomas Pfaff <tpfaff@gmx.net>
+
+ * dll_init.h (per_process::dtors_run): New member.
+ * dll_init.cc (per_module::run_dtors): Run dtors only once.
+ (dll::init): Initialize dtors_run flag.
+
Wed Apr 17 11:27:04 2002 Jason Tishler <jason@tishler.net>
* security.cc (get_lsa_srv_inf): Prevent extraneous backslashes for
diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc
index e5e650fa9..4ff740cc4 100644
--- a/winsup/cygwin/dll_init.cc
+++ b/winsup/cygwin/dll_init.cc
@@ -59,6 +59,11 @@ void
per_module::run_dtors ()
{
void (**pfunc)() = dtors;
+
+ if( dtors_run )
+ return;
+ dtors_run = true;
+
for (int i = 1; pfunc[i]; i++)
(pfunc[i]) ();
}
@@ -72,6 +77,8 @@ dll::init ()
/* Why didn't we just import this variable? */
*(p.envptr) = __cygwin_environ;
+ p.dtors_run = false;
+
/* Don't run constructors or the "main" if we've forked. */
if (!in_forkee)
{
diff --git a/winsup/cygwin/dll_init.h b/winsup/cygwin/dll_init.h
index bc9687bf7..848d4d5ad 100644
--- a/winsup/cygwin/dll_init.h
+++ b/winsup/cygwin/dll_init.h
@@ -13,6 +13,7 @@ struct per_module
char ***envptr;
void (**ctors)(void);
void (**dtors)(void);
+ bool dtors_run;
void *data_start;
void *data_end;
void *bss_start;