Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-10-15 11:03:45 +0400
committerChristopher Faylor <me@cgf.cx>2002-10-15 11:03:45 +0400
commitfdb28b5e5f813721add3ba2b261dfe78f3b895cb (patch)
tree8bf842ee31e89bf925b36aaa4c882d77cc3bb544 /winsup/cygwin/dcrt0.cc
parent54030e2146f80ba055f4b7efa20467beab1487e9 (diff)
* child_info.h (CURR_CHILD_INFO_MAGIC): Reset.
(child_info_fork::mount_table): Remove. (child_info_fork::myself_addr): Remove. * fork.cc (fork_child): Don't set either of the above. * dcrt0.cc (dll_crt0_1): Call memory_init as early as possible. * fhandler_console.cc (console_state): Move to shared_info.h. (fhandler_console::get_tty_stuff): Reflect open_shared arg change. * pinfo.cc (myself_addr): Remove definition. (pinfo::init): Get myself address from open_shared. * pinfo.h (myself_addr): Remove declaration. * shared.cc (open_shared): Rework so that known shared memory locations are protected. Take shared memory type as fifth argument. (memory_init): Reflect open_shared arg change. * shared_info.h (shared_locations): New enum. (console_state): Move here. (open_shared): Reflect open_shared arg change in declaration.
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r--winsup/cygwin/dcrt0.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index e7babe08b..4270c58a4 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -572,7 +572,9 @@ dll_crt0_1 ()
int envc = 0;
char **envp = NULL;
- if (child_proc_info)
+ if (!child_proc_info)
+ memory_init ();
+ else
{
bool close_ppid_handle = false;
bool close_hexec_proc = false;
@@ -581,10 +583,9 @@ dll_crt0_1 ()
case _PROC_FORK:
cygheap_fixup_in_child (0);
alloc_stack (fork_info);
- mount_table = fork_info->mount_table;
- myself_addr = fork_info->myself_addr;
- set_myself (mypid);
close_ppid_handle = !!child_proc_info->pppid_handle;
+ memory_init ();
+ set_myself (mypid);
break;
case _PROC_SPAWN:
/* Have to delay closes until after cygheap is setup */
@@ -596,6 +597,7 @@ dll_crt0_1 ()
around:
HANDLE h;
cygheap_fixup_in_child (1);
+ memory_init ();
if (!spawn_info->moreinfo->myself_pinfo ||
!DuplicateHandle (hMainProc, spawn_info->moreinfo->myself_pinfo,
hMainProc, &h, 0, 0,
@@ -622,9 +624,6 @@ dll_crt0_1 ()
CloseHandle (child_proc_info->pppid_handle);
}
- /* Initialize the cygwin subsystem if this is the first process,
- or attach to shared data structures if it's already running. */
- memory_init ();
cygthread::init ();
ProtectHandle (hMainProc);