diff options
author | Christopher Faylor <me@cgf.cx> | 2006-05-27 18:50:04 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2006-05-27 18:50:04 +0000 |
commit | 344be4a7196cc4702437de93318d228f6b4b90bb (patch) | |
tree | 3ed3e2c6e79318025d9b672c3b0aeeee513bec55 /winsup/cygwin | |
parent | ee99fad3504f5d1fe86f5df728a28ec54f787b37 (diff) | |
download | newlib-344be4a7196cc4702437de93318d228f6b4b90bb.zip newlib-344be4a7196cc4702437de93318d228f6b4b90bb.tar.gz newlib-344be4a7196cc4702437de93318d228f6b4b90bb.tar.bz2 |
* dll_init.cc (dll_dllcrt0): Call _my_tls.init_exception_handler if we've
finished initializing (Thanks to Gary Zablackis for noticing this problem).
Just use cygwin_finished_initializing rather than defining a separate variable.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/cygwin/dll_init.cc | 8 |
2 files changed, 12 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 5b1db33..784f58e 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2006-05-27 Christopher Faylor <cgf@timesys.com> + + * dll_init.cc (dll_dllcrt0): Call _my_tls.init_exception_handler if + we've finished initializing (Thanks to Gary Zablackis for noticing this + problem). Just use cygwin_finished_initializing rather than defining a + separate variable. + 2006-05-25 Christopher Faylor <cgf@timesys.com> * debug.h (ModifyHandle): Define new macro. diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc index b1aceec..418cb52 100644 --- a/winsup/cygwin/dll_init.cc +++ b/winsup/cygwin/dll_init.cc @@ -351,11 +351,13 @@ dll_list::load_after_fork (HANDLE parent, dll *first) extern "C" int dll_dllcrt0 (HMODULE h, per_process *p) { + if (cygwin_finished_initializing) + _my_tls.init_exception_handler (_cygtls::handle_exceptions); + if (p == NULL) p = &__cygwin_user_data; else *(p->impure_ptr_ptr) = __cygwin_user_data.impure_ptr; - bool initializing = in_forkee || cygwin_finished_initializing; /* Partially initialize Cygwin guts for non-cygwin apps. */ if (dynamically_loaded && user_data->magic_biscuit == 0) @@ -369,7 +371,7 @@ dll_dllcrt0 (HMODULE h, per_process *p) initializing, then the DLL must be a cygwin-aware DLL that was explicitly linked into the program rather than a dlopened DLL. */ - if (!initializing) + if (cygwin_finished_initializing) type = DLL_LINK; else { @@ -385,7 +387,7 @@ dll_dllcrt0 (HMODULE h, per_process *p) initialize the DLL. If we haven't finished initializing, it may not be safe to call the dll's "main" since not all of cygwin's internal structures may have been set up. */ - if (!d || (initializing && !d->init ())) + if (!d || (cygwin_finished_initializing && !d->init ())) return -1; return (DWORD) d; |