From 7da53596cf1385616721180b48b2159802045d1c Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 9 Oct 2002 04:08:05 +0000 Subject: * cygheap.cc (dup_now): Make fatal error a little more informative. (cygheap_setup_for_child): Detect when default size of shared region is less than the current size and allocate that much. (_cbrk): Just return NULL on inability to allocate. (_cmalloc): Ditto. * cygheap.h (CYGHEAPSIZE): Change size to reflect newer, tinier fhandler sizes. * spawn.cc (av::error): New element, reflects potential errno from cmalloc. (av::~av): Don't free NULL pointers. (av::replace0_maybe): Detect out-of-memory conditions. (av::dup_maybe): Ditto. (av::dup_all): Ditto. (av::unshift): Ditto. (spawn_guts): Set errno and return if argv creation ran into problems. * fhandler.h (fhandler_union): Change member names to something safer. * fhandler_console.cc (fhandler_console::get_tty_stuff): Always set fhandler_console::dev_state regardless of whether shared region is initialized. * cygthread.cc (cygthread::runner): Use ExitThread rather than return (planning for future). --- winsup/cygwin/fhandler_console.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'winsup/cygwin/fhandler_console.cc') diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 953e9c5c5..4b7c2daef 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -100,12 +100,14 @@ dev_console NO_COPY *fhandler_console::dev_state; tty_min * fhandler_console::get_tty_stuff (int flags = 0) { - if (shared_console_info) + if (dev_state) return &shared_console_info->tty_min_state; shared_console_info = (console_state *) open_shared (NULL, 0, cygheap->console_h, sizeof (*shared_console_info), NULL); + dev_state = &shared_console_info->dev_state; + ProtectHandleINH (cygheap->console_h); if (!shared_console_info->tty_min_state.ntty) { @@ -113,7 +115,6 @@ fhandler_console::get_tty_stuff (int flags = 0) shared_console_info->tty_min_state.setsid (myself->sid); shared_console_info->tty_min_state.set_ctty (TTY_CONSOLE, flags); - fhandler_console::dev_state = &shared_console_info->dev_state; dev_state->scroll_region.Bottom = -1; dev_state->dwLastCursorPosition.X = -1; dev_state->dwLastCursorPosition.Y = -1; -- cgit v1.2.3