Page MenuHomeFreeBSD

D26148.id76069.diff
No OneTemporary

D26148.id76069.diff

Index: sys/kern/tty_ttydisc.c
===================================================================
--- sys/kern/tty_ttydisc.c
+++ sys/kern/tty_ttydisc.c
@@ -94,7 +94,7 @@
{
/* Clean up our flags when leaving the discipline. */
- tp->t_flags &= ~(TF_STOPPED|TF_HIWAT|TF_ZOMBIE);
+ tp->t_flags &= ~(TF_STOPPED|TF_HIWAT|TF_ZOMBIE|TF_DISCARD);
/*
* POSIX states that we must drain output and flush input on
@@ -463,6 +463,11 @@
if (tp->t_flags & TF_ZOMBIE)
return (EIO);
+ if (tp->t_flags & TF_DISCARD) {
+ uio->uio_resid = 0;
+ return (0);
+ }
+
/*
* We don't need to check whether the process is the foreground
* process group or if we have a carrier. This is already done
@@ -906,6 +911,13 @@
tp->t_flags |= TF_LITERAL;
return (0);
}
+ /* Discard processing */
+ if (CMP_CC(VDISCARD, c)) {
+ if (CMP_FLAG(l, ECHO)) {
+ ttydisc_echo(tp, c, 0);
+ }
+ tp->t_flags ^= TF_DISCARD;
+ }
}
/*
Index: sys/sys/tty.h
===================================================================
--- sys/sys/tty.h
+++ sys/sys/tty.h
@@ -89,6 +89,7 @@
#define TF_BUSY_IN 0x20000 /* Process busy in read() -- not supported. */
#define TF_BUSY_OUT 0x40000 /* Process busy in write(). */
#define TF_BUSY (TF_BUSY_IN|TF_BUSY_OUT)
+#define TF_DISCARD 0x80000 /* Discard all output. */
unsigned int t_revokecnt; /* (t) revoke() count. */
/* Buffering mechanisms. */

File Metadata

Mime Type
text/plain
Expires
Sun, Jun 14, 3:42 PM (2 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33955674
Default Alt Text
D26148.id76069.diff (1 KB)

Event Timeline