diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2008-07-25 15:23:56 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2008-07-25 15:23:56 +0000 |
commit | 1d011c0a689efbfcfcb336490af337d7a4a9d320 (patch) | |
tree | 21d9e66a3d42fe7749f132762b550157f9f14c42 /winsup/cygwin/dcrt0.cc | |
parent | 5f853b3fc5277da8cb5ba3ac7406447fe82e65de (diff) | |
download | cygnal-1d011c0a689efbfcfcb336490af337d7a4a9d320.tar.gz cygnal-1d011c0a689efbfcfcb336490af337d7a4a9d320.tar.bz2 cygnal-1d011c0a689efbfcfcb336490af337d7a4a9d320.zip |
* dcrt0.cc (dll_crt0_0): Call malloc_init and user_shared_initialize_1
here in case we're dynamically loaded. Explain why.
(dll_crt0_1): Call user_shared_initialize_1 from here.
* mount.cc (is_native_path): New inline function testing for native
and long Win32 path prefix.
(is_unc_share): Remove long WIn32 path prefix test.
(mount_info::create_root_entry): Use PATH_MAX buffer.
(mount_info::init): Ditto.
(mount_info::add_item): Test for is_native_path as well.
* path.cc (normalize_win32_path): Simplify native path prefix code.
* shared.cc (user_shared_initialize_1): New function taking user
shared initialization code relying on malloc and cygtls.
(user_shared_initialize): Move mountinfo initialization to
user_shared_initialize_1.
* shared_info.h (user_shared_initialize_1): Declare.
* syscalls.cc (seteuid32): Call user_shared_initialize_1 after user
changed.
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r-- | winsup/cygwin/dcrt0.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index dddb97f53..5fbf2df05 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -752,6 +752,20 @@ 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"); } @@ -774,6 +788,8 @@ dll_crt0_1 (void *) ProtectHandle (hMainProc); ProtectHandle (hMainThread); + user_shared_initialize_1 (); + cygheap->cwd.init (); /* Initialize pthread mainthread when not forked and it is safe to call new, |