* cygheap.cc (cygheap_fixup_in_child): Don't close parent handle here. Let the

caller do that.
* dcrt0.cc (child_info_spawn::handle_spawn): Close parent handle here to allow
fixup_after_exec functions to use it.
* cygtls.cc (_cygtls::call2): Avoid calling exit thread if called with
*crt0_1 functions.
* cygtls.h (_cygtls::isinitialized): Check that we actually have a tls before
seeing if it is initialized.
* gendef (_sigfe_maybe): Ditto.
* dcrt0.cc (dll_crt0_1): Remove static, use just one argument.
* dll_init.cc (dllcrt0_info): New structure.
(dll_dllcrt0): Change into a front-end to renamed dll_dllcrt0_1 so that we'll
always be assured of having something like a tls.
(dll_dllcrt0_1): New function, basically renamed from from dll_dllcrt0.
Unconditionally call _my_tls.init_exception_handler now that we are assured of
having a tls.  Change variable name from "linking" to "linked".
* winsup.h (dll_crt0_1): Declare.
(dll_dllcrt0_1): Ditto.
This commit is contained in:
Christopher Faylor
2006-06-02 00:09:50 +00:00
parent 3e1290a305
commit 2346864a45
8 changed files with 75 additions and 22 deletions

View File

@@ -692,6 +692,12 @@ child_info_spawn::handle_spawn ()
envc = moreinfo->envc;
if (!dynamically_loaded)
cygheap->fdtab.fixup_after_exec ();
/* Need to do this after debug_fixup_after_fork_exec or DEBUGGING handling of
handles might get confused. */
CloseHandle (child_proc_info->parent);
child_proc_info->parent = NULL;
signal_fixup_after_exec ();
if (moreinfo->old_title)
{
@@ -783,8 +789,8 @@ dll_crt0_0 ()
various special cases when Cygwin DLL is being runtime loaded (as
opposed to being link-time loaded by Cygwin apps) from a non
cygwin app via LoadLibrary. */
static void
dll_crt0_1 (void *, void *)
void
dll_crt0_1 (void *)
{
check_sanity_and_sync (user_data);
malloc_init ();