* cygheap.h (init_cygheap::ctty): Use base class so that console can join in

the fun.
* dtable.cc (dtable::stdio_init): Remove special-case call to set_console_ctty
().
* exceptions.cc (sigpacket::process): Conditionally flush terminal input on
certain signals.
* fhandler.h (fhandler_console::get_tty_stuff): Make non-static.
(fhandler_termios::get_ttyp): Move here.
(fhandler_termios::sigflush): Declare.
(fhandler_tty_common::get_ttyp): Delete.
* fhandler_console.cc (fhandler_console::get_tty_stuff): Pass this as "arch"
argument.
(set_console_ctty): Delete.
(tty_list::get_tty): Just return pointer to shared console region, delaying
get_tty_stuff until open().
(fhandler_console::init): Treat NULL handle as signifying that console should
be opened with O_NOCTTY flag.  Rename handle argument to the more common 'h'.
* fhandler_termios.cc (fhandler_termios::sigflush): Define.
* fhandler_tty.cc (handler_tty_master::init_console): Pass NULL as first
argument to fhandler_console::init.
* pinfo.cc (_pinfo::set_ctty): Change third parameter to fhandler_termios *.
Add extra debugging.
* pinfo.h (_pinfo::set_ctty): Change third parameter to fhandler_termios *.
* sigproc.cc (handle_sigsuspend): Don't special-case non-main threads.
This commit is contained in:
Christopher Faylor
2011-04-17 19:56:25 +00:00
parent 0fbf39cc9f
commit f4c1f003e3
10 changed files with 67 additions and 34 deletions

View File

@ -912,6 +912,8 @@ class fhandler_termios: public fhandler_base
void set_output_handle (HANDLE h) { output_handle = h; }
void tcinit (tty_min *this_tc, bool force);
bool is_tty () const { return true; }
tty *get_ttyp () { return (tty *) tc; }
void sigflush ();
int tcgetpgrp ();
int tcsetpgrp (int pid);
bg_check_types bg_check (int sig);
@ -1083,7 +1085,7 @@ class fhandler_console: public fhandler_termios
void set_close_on_exec (bool val);
void set_input_state ();
void send_winch_maybe ();
static tty_min *get_tty_stuff (int);
tty_min *get_tty_stuff (int);
bool is_slow () {return true;}
static bool need_invisible ();
static bool has_a () {return !invisible_console;}
@ -1111,8 +1113,6 @@ class fhandler_tty_common: public fhandler_termios
DWORD __acquire_output_mutex (const char *fn, int ln, DWORD ms);
void __release_output_mutex (const char *fn, int ln);
tty *get_ttyp () { return (tty *) tc; }
int close ();
_off64_t lseek (_off64_t, int);
void set_close_on_exec (bool val);