* 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().
This commit is contained in:
Christopher Faylor
2008-07-27 22:31:48 +00:00
parent b58e5f427a
commit 038af33480
5 changed files with 46 additions and 47 deletions

View File

@ -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;