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
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r--winsup/cygwin/dcrt0.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index 7cd383bf7..6745f096e 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -955,11 +955,16 @@ _dll_crt0 ()
{
main_environ = user_data->envptr;
if (in_forkee)
- fork_info->alloc_stack ();
+ {
+ fork_info->alloc_stack ();
+ _main_tls = &_my_tls;
+ }
else
- __sinit (_impure_ptr);
+ {
+ _main_tls = &_my_tls;
+ __sinit (_impure_ptr);
+ }
- _main_tls = &_my_tls;
_main_tls->call ((DWORD (*) (void *, void *)) dll_crt0_1, NULL);
}