From: Ben Gras Date: Mon, 6 Apr 2009 09:39:42 +0000 (+0000) Subject: don't flush output for SIGWINCH. found by Joren l'Ami. X-Git-Tag: v3.1.4~78 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=4cd6875d05dcba63a8e9641ce70626cb6c1afea7;p=minix.git don't flush output for SIGWINCH. found by Joren l'Ami. --- diff --git a/drivers/tty/keyboard.c b/drivers/tty/keyboard.c index 8fc9176f4..018ce0118 100644 --- a/drivers/tty/keyboard.c +++ b/drivers/tty/keyboard.c @@ -609,9 +609,9 @@ int try; switch(ch) { case CF1: show_key_mappings(); break; case CF3: toggle_scroll(); break; /* hardware <-> software */ - case CF7: sigchar(&tty_table[CONSOLE], SIGQUIT); break; - case CF8: sigchar(&tty_table[CONSOLE], SIGINT); break; - case CF9: sigchar(&tty_table[CONSOLE], SIGKILL); break; + case CF7: sigchar(&tty_table[CONSOLE], SIGQUIT, 1); break; + case CF8: sigchar(&tty_table[CONSOLE], SIGINT, 1); break; + case CF9: sigchar(&tty_table[CONSOLE], SIGKILL, 1); break; } } } diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index ca408d691..d7949f8c5 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c @@ -172,7 +172,7 @@ message *m_ptr; pp->state = 0; } else { pp->state |= PTY_CLOSED; - sigchar(tp, SIGHUP); + sigchar(tp, SIGHUP, 1); } break; diff --git a/drivers/tty/rs232.c b/drivers/tty/rs232.c index aed377b25..306624042 100644 --- a/drivers/tty/rs232.c +++ b/drivers/tty/rs232.c @@ -612,7 +612,7 @@ int try; rs->ostate &= ~ODEVHUP; /* save ostate, clear DEVHUP */ unlock(); if (ostate & ODEVHUP) { - sigchar(tp, SIGHUP); + sigchar(tp, SIGHUP, 1); tp->tty_termios.c_ospeed = B0; /* Disable further I/O. */ return 0; } diff --git a/drivers/tty/tty.c b/drivers/tty/tty.c index 537109996..c87301fa3 100644 --- a/drivers/tty/tty.c +++ b/drivers/tty/tty.c @@ -672,7 +672,7 @@ int safe; r = sys_vircopy( m_ptr->IO_ENDPT, D, (vir_bytes) m_ptr->ADDRESS, SELF, D, (vir_bytes) &tp->tty_winsize, (vir_bytes) size); } - sigchar(tp, SIGWINCH); + sigchar(tp, SIGWINCH, 0); break; #if (MACHINE == IBM_PC) @@ -1097,7 +1097,7 @@ int count; /* number of input characters */ || ch == tp->tty_termios.c_cc[VQUIT]) { sig = SIGINT; if (ch == tp->tty_termios.c_cc[VQUIT]) sig = SIGQUIT; - sigchar(tp, sig); + sigchar(tp, sig, 1); (void) tty_echo(tp, ch); continue; } @@ -1445,7 +1445,7 @@ tty_t *tp; } /* Setting the output speed to zero hangs up the phone. */ - if (tp->tty_termios.c_ospeed == B0) sigchar(tp, SIGHUP); + if (tp->tty_termios.c_ospeed == B0) sigchar(tp, SIGHUP, 1); /* Set new line speed, character size, etc at the device level. */ (*tp->tty_ioctl)(tp, 0); @@ -1489,9 +1489,10 @@ int status; /* reply code */ /*===========================================================================* * sigchar * *===========================================================================*/ -PUBLIC void sigchar(tp, sig) +PUBLIC void sigchar(tp, sig, mayflush) register tty_t *tp; int sig; /* SIGINT, SIGQUIT, SIGKILL or SIGHUP */ +int mayflush; { /* Process a SIGINT, SIGQUIT or SIGKILL char from the keyboard or SIGHUP from * a tty close, "stty 0", or a real RS-232 hangup. MM will send the signal to @@ -1506,7 +1507,7 @@ int sig; /* SIGINT, SIGQUIT, SIGKILL or SIGHUP */ } } - if (!(tp->tty_termios.c_lflag & NOFLSH)) { + if (mayflush && !(tp->tty_termios.c_lflag & NOFLSH)) { tp->tty_incount = tp->tty_eotct = 0; /* kill earlier input */ tp->tty_intail = tp->tty_inhead; (*tp->tty_ocancel)(tp, 0); /* kill all output */ diff --git a/drivers/tty/tty.h b/drivers/tty/tty.h index d2add8448..7defd7719 100644 --- a/drivers/tty/tty.h +++ b/drivers/tty/tty.h @@ -148,7 +148,7 @@ extern struct kmessages kmess; /* Function prototypes for TTY driver. */ /* tty.c */ _PROTOTYPE( void handle_events, (struct tty *tp) ); -_PROTOTYPE( void sigchar, (struct tty *tp, int sig) ); +_PROTOTYPE( void sigchar, (struct tty *tp, int sig, int mayflush) ); _PROTOTYPE( void tty_task, (void) ); _PROTOTYPE( int in_process, (struct tty *tp, char *buf, int count) ); _PROTOTYPE( void out_process, (struct tty *tp, char *bstart, char *bpos,