From 54030e2146f80ba055f4b7efa20467beab1487e9 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Mon, 14 Oct 2002 20:25:52 +0000 Subject: * child_info.h (CURR_CHILD_INFO_MAGIC): Reset. (child_info_fork::heaptop): Remove obsolete element. (child_info_fork::heabbase): Ditto. (child_info_fork::heapptr): Ditto. (child_info_fork::mount_table): New element. (child_info_fork::myself_addr): Ditto. * dcrt0.cc (dll_crt0_1): Set mount_table and myself_addr when forking. (initial_env): Add newline to "sleeping" message. * dll_init.cc (reserve_upto): Accommodate cygwin heap when freeing memory. Make debugging output a little more descriptive. * fork.cc (fork_parent): Save mount_table and myself_addr. * pinfo.cc (myself_addr): New variable. (set_myself): Pass PID_MYSELF flag to init. (pinfo::Init): Honor PID_MYSELF. Save address where myself shared memory resides in myself_addr, for fork. * pinfo.h (myself_addr): Declare. * shared.cc (memory_init): On fork, use previously saved address for location of mount table. * include/sys/cygwin.h (PID_MYSELF): New value. * dtable.cc (dtable::stdio_init): Don't pass access type to init_std_file_from_handle. It's always the same. (dtable::init_std_file_from_handle): Remove access type argument. Assume read/write. * dtable.h (dtable::init_std_file_from_handle): Ditto for declaration. * exceptions.cc (try_to_debug): Don't try to debug if already being debugged. * fhandler_console.cc (shared_console_info_save): New variable. (fhandler_console::get_tty_stuff): Save address of shared console stuff for fork. --- winsup/cygwin/fhandler_console.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'winsup/cygwin/fhandler_console.cc') diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 4b7c2daef..a43dad11f 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -91,7 +91,8 @@ struct console_state dev_console dev_state; }; -static console_state NO_COPY *shared_console_info = NULL; +static console_state NO_COPY *shared_console_info; +static console_state *shared_console_info_save; dev_console NO_COPY *fhandler_console::dev_state; @@ -103,9 +104,10 @@ fhandler_console::get_tty_stuff (int flags = 0) if (dev_state) return &shared_console_info->tty_min_state; - shared_console_info = + shared_console_info = shared_console_info_save = (console_state *) open_shared (NULL, 0, cygheap->console_h, - sizeof (*shared_console_info), NULL); + sizeof (*shared_console_info), + shared_console_info_save); dev_state = &shared_console_info->dev_state; ProtectHandleINH (cygheap->console_h); -- cgit v1.2.3