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-09 08:08:05 +0400
committerChristopher Faylor <me@cgf.cx>2002-10-09 08:08:05 +0400
commit7da53596cf1385616721180b48b2159802045d1c (patch)
tree7c7c049a2429b3d778f4d8f33ede670f44fb7d58 /winsup/cygwin/fhandler_console.cc
parentce6ac4003f2155c0f76d086673aa12193661e1c3 (diff)
* 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).
Diffstat (limited to 'winsup/cygwin/fhandler_console.cc')
-rw-r--r--winsup/cygwin/fhandler_console.cc5
1 files changed, 3 insertions, 2 deletions
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;