* 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:
@ -1,7 +1,7 @@
|
||||
/* exceptions.cc
|
||||
|
||||
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
||||
2005, 2006, 2007, 2008, 2009, 2010 Red Hat, Inc.
|
||||
2005, 2006, 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
|
||||
|
||||
This file is part of Cygwin.
|
||||
|
||||
@ -712,12 +712,6 @@ exception::handle (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in, void
|
||||
int __stdcall
|
||||
handle_sigsuspend (sigset_t tempmask)
|
||||
{
|
||||
if (&_my_tls != _main_tls)
|
||||
{
|
||||
cancelable_wait (signal_arrived, INFINITE, cw_cancel_self);
|
||||
return -1;
|
||||
}
|
||||
|
||||
sigset_t oldmask = _my_tls.sigmask; // Remember for restoration
|
||||
|
||||
set_signal_mask (tempmask, _my_tls.sigmask);
|
||||
@ -1174,6 +1168,19 @@ sigpacket::process ()
|
||||
sig_clear (SIGTTOU);
|
||||
}
|
||||
|
||||
switch (si.si_signo)
|
||||
{
|
||||
case SIGINT:
|
||||
case SIGQUIT:
|
||||
case SIGSTOP:
|
||||
case SIGTSTP:
|
||||
if (cygheap->ctty)
|
||||
cygheap->ctty->sigflush ();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
int rc = 1;
|
||||
|
||||
sigproc_printf ("signal %d processing", si.si_signo);
|
||||
|
Reference in New Issue
Block a user