Cygwin: pty: Change the condition to send Ctrl-C event.
- Previously, non-cygwin app started by "script -c <non-cygwin app>" receives Ctrl-C twice. This patch fixes the issue.
This commit is contained in:
parent
3c4ed01b18
commit
8ff0657295
|
@ -324,9 +324,6 @@ fhandler_termios::process_sigs (char c, tty* ttyp, fhandler_termios *fh)
|
||||||
pid_t pgid = ttyp->pgid;
|
pid_t pgid = ttyp->pgid;
|
||||||
|
|
||||||
/* The name *_nat stands for 'native' which means non-cygwin apps. */
|
/* The name *_nat stands for 'native' which means non-cygwin apps. */
|
||||||
pinfo leader (pgid);
|
|
||||||
bool cyg_leader = /* The process leader is a cygwin process. */
|
|
||||||
leader && !(leader->process_state & PID_NOTCYGWIN);
|
|
||||||
bool ctrl_c_event_sent = false;
|
bool ctrl_c_event_sent = false;
|
||||||
bool need_discard_input = false;
|
bool need_discard_input = false;
|
||||||
bool pg_with_nat = false; /* The process group has non-cygwin processes. */
|
bool pg_with_nat = false; /* The process group has non-cygwin processes. */
|
||||||
|
@ -385,9 +382,9 @@ fhandler_termios::process_sigs (char c, tty* ttyp, fhandler_termios *fh)
|
||||||
if ((p->process_state & PID_NEW_PG)
|
if ((p->process_state & PID_NEW_PG)
|
||||||
&& (p->process_state & PID_NOTCYGWIN))
|
&& (p->process_state & PID_NOTCYGWIN))
|
||||||
GenerateConsoleCtrlEvent (CTRL_BREAK_EVENT, p->dwProcessId);
|
GenerateConsoleCtrlEvent (CTRL_BREAK_EVENT, p->dwProcessId);
|
||||||
else if ((!fh || fh->need_send_ctrl_c_event () || cyg_leader)
|
else if ((!fh || fh->need_send_ctrl_c_event ()
|
||||||
&& !ctrl_c_event_sent) /* cyg_leader is needed by GDB
|
|| p->exec_dwProcessId == p->dwProcessId)
|
||||||
with non-cygwin inferior */
|
&& !ctrl_c_event_sent)
|
||||||
{
|
{
|
||||||
GenerateConsoleCtrlEvent (CTRL_C_EVENT, 0);
|
GenerateConsoleCtrlEvent (CTRL_C_EVENT, 0);
|
||||||
ctrl_c_event_sent = true;
|
ctrl_c_event_sent = true;
|
||||||
|
|
Loading…
Reference in New Issue