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>2011-04-21 04:53:55 +0400
committerChristopher Faylor <me@cgf.cx>2011-04-21 04:53:55 +0400
commit71c17c540231c3b824474431f2be0bd5ce63005f (patch)
tree29ddf6d9c57e712238eaca5629fb5524ab24c17b /winsup/cygwin/cygheap.cc
parent2f9c27131fc48d8364e0ef16332cf6e6402c4fdd (diff)
* cygheap.cc (init_cygheap::close_ctty): Avoid closing console-cttys since they
don't use archetypes and this will just result in double frees. * dll_init.cc (dll_list::protect): Define. (dll_list::alloc): Guard list access. (dll_list::detach): Ditto. * dll_init.h (dll_list::protect): Declare new muto. (dll_list::guard): Define/declare function to guard list access. * fhandler_termios.cc (fhandler_termios::sigflush): Avoid SEGV in pathological condition of get_ttyp() == NULL.
Diffstat (limited to 'winsup/cygwin/cygheap.cc')
-rw-r--r--winsup/cygwin/cygheap.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc
index 00e9796f6..8dde3dfe9 100644
--- a/winsup/cygwin/cygheap.cc
+++ b/winsup/cygwin/cygheap.cc
@@ -15,6 +15,7 @@
#include "cygerrno.h"
#include "security.h"
#include "path.h"
+#include "tty.h"
#include "fhandler.h"
#include "dtable.h"
#include "cygheap.h"
@@ -106,7 +107,11 @@ void
init_cygheap::close_ctty ()
{
debug_printf ("closing cygheap->ctty %p", cygheap->ctty);
- cygheap->ctty->close ();
+ /* FIXME: Support for console-as-ctty is limited due to the fact that
+ the console doesn't use archetypes - even though they could and should */
+ if (cygheap->ctty->get_ttyp ()
+ && cygheap->ctty->get_ttyp ()->ntty != TTY_CONSOLE)
+ cygheap->ctty->close ();
cygheap->ctty = NULL;
}