diff options
Diffstat (limited to 'winsup/cygwin/cygheap.cc')
-rw-r--r-- | winsup/cygwin/cygheap.cc | 7 |
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; } |