diff options
author | Christopher Faylor <me@cgf.cx> | 2008-07-27 22:31:48 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2008-07-27 22:31:48 +0000 |
commit | 038af33480450d3092adb520ce0974cb23efde9c (patch) | |
tree | 78c3033e59bb364c54f1a5790e4404e64a0baca4 /winsup/cygwin/dcrt0.cc | |
parent | b58e5f427a6905c1cefb2205c2359eef177dfb3a (diff) | |
download | cygnal-038af33480450d3092adb520ce0974cb23efde9c.tar.gz cygnal-038af33480450d3092adb520ce0974cb23efde9c.tar.bz2 cygnal-038af33480450d3092adb520ce0974cb23efde9c.zip |
* dcrt0.cc (dll_crt0_0): Remove calling malloc_init and
user_shared_initialize_1 from here.
(dll_crt0_1): Remove dynamically_loaded check. Just call malloc_init and
user_shared_initialize unconditionally.
* shared.cc (user_shared_create): Rename from user_shared_initialize.
(user_shared_initialize): Rename from user_shared_initialize_1. Move complete
user_shared content initialization code here from user_shared_create.
* syscalls.cc (seteuid32): Remove call to user_shared_initialize_1. That is
implied by the "true" argument to user_shared_create().
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r-- | winsup/cygwin/dcrt0.cc | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index 5c85eb834..6b2d283fd 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -752,20 +752,6 @@ dll_crt0_0 () events_init (); tty_list::init_session (); - if (dynamically_loaded) - { - /* When dynamically loaded. we must initialize the user shared memory - entirely here since dll_crt0_1 will not be called. Stuff in - user_shared_initialize_1 relies on malloc and cygtls being available - and the initialization isn't finished without calling it. In the - non-dynamical case this is called in dll_crt0_1, because malloc_init - has to test for overloaded malloc functionality in the application. - That's not an issue when cygwin is loaded dynamically. It will just - use its own malloc area. */ - malloc_init (); - user_shared_initialize_1 (); - } - debug_printf ("finished dll_crt0_0 initialization"); } @@ -778,11 +764,12 @@ dll_crt0_1 (void *) { check_sanity_and_sync (user_data); - if (!dynamically_loaded) - { - malloc_init (); - user_shared_initialize_1 (); - } + /* Initialize malloc and then call user_shared_initialize since it relies + on a functioning malloc and it's possible that the user's program may + have overridden malloc. We only know about that at this stage, + unfortunately. */ + malloc_init (); + user_shared_initialize (); #ifdef CGF int i = 0; |