Page MenuHomeFreeBSD

D26148.diff
No OneTemporary

D26148.diff

Index: sys/kern/tty.c
===================================================================
--- sys/kern/tty.c
+++ sys/kern/tty.c
@@ -1467,6 +1467,7 @@
/* Make signals start output again. */
tp->t_flags &= ~TF_STOPPED;
+ tp->t_termios.c_lflag &= ~FLUSHO;
if (tp->t_session != NULL && tp->t_session->s_leader != NULL) {
p = tp->t_session->s_leader;
@@ -1486,6 +1487,7 @@
/* Make signals start output again. */
tp->t_flags &= ~TF_STOPPED;
+ tp->t_termios.c_lflag &= ~FLUSHO;
if (sig == SIGINFO && !(tp->t_termios.c_lflag & NOKERNINFO))
tty_info(tp);
@@ -1930,6 +1932,7 @@
return (0);
case TIOCSTART:
tp->t_flags &= ~TF_STOPPED;
+ tp->t_termios.c_lflag &= ~FLUSHO;
ttydevsw_outwakeup(tp);
ttydevsw_pktnotify(tp, TIOCPKT_START);
return (0);
Index: sys/kern/tty_ttydisc.c
===================================================================
--- sys/kern/tty_ttydisc.c
+++ sys/kern/tty_ttydisc.c
@@ -95,6 +95,7 @@
/* Clean up our flags when leaving the discipline. */
tp->t_flags &= ~(TF_STOPPED|TF_HIWAT|TF_ZOMBIE);
+ tp->t_termios.c_lflag &= ~FLUSHO;
/*
* POSIX states that we must drain output and flush input on
@@ -474,6 +475,12 @@
MPASS(oblen == 0);
+ if (CMP_FLAG(l, FLUSHO)) {
+ uio->uio_offset += uio->uio_resid;
+ uio->uio_resid = 0;
+ return (0);
+ }
+
/* Step 1: read data. */
obstart = ob;
nlen = MIN(uio->uio_resid, sizeof ob);
@@ -495,6 +502,12 @@
do {
unsigned int plen, wlen;
+ if (CMP_FLAG(l, FLUSHO)) {
+ uio->uio_offset += uio->uio_resid;
+ uio->uio_resid = 0;
+ return (0);
+ }
+
/* Search for special characters for post processing. */
if (CMP_FLAG(o, OPOST)) {
plen = ttydisc_findchar(obstart, oblen);
@@ -629,6 +642,9 @@
ttydisc_echo_force(struct tty *tp, char c, int quote)
{
+ if (CMP_FLAG(l, FLUSHO))
+ return 0;
+
if (CMP_FLAG(o, OPOST) && CTL_ECHO(c, quote)) {
/*
* Only perform postprocessing when OPOST is turned on
@@ -879,8 +895,10 @@
}
/* Allow any character to perform a wakeup. */
- if (CMP_FLAG(i, IXANY))
+ if (CMP_FLAG(i, IXANY)) {
tp->t_flags &= ~TF_STOPPED;
+ tp->t_termios.c_lflag &= ~FLUSHO;
+ }
/* Remove the top bit. */
if (CMP_FLAG(i, ISTRIP))
@@ -906,6 +924,18 @@
tp->t_flags |= TF_LITERAL;
return (0);
}
+ /* Discard processing */
+ if (CMP_CC(VDISCARD, c)) {
+ if (CMP_FLAG(l, FLUSHO)) {
+ tp->t_termios.c_lflag &= ~FLUSHO;
+ } else {
+ tty_flush(tp, FWRITE);
+ ttydisc_echo(tp, c, 0);
+ if (tp->t_inq.ti_end > 0)
+ ttydisc_reprint(tp);
+ tp->t_termios.c_lflag |= FLUSHO;
+ }
+ }
}
/*

File Metadata

Mime Type
text/plain
Expires
Sat, May 23, 10:38 AM (3 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33445133
Default Alt Text
D26148.diff (2 KB)

Event Timeline