PERFORCE change 150174 for review

Ed Schouten ed at FreeBSD.org
Sat Sep 20 19:29:55 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=150174

Change 150174 by ed at ed_dull on 2008/09/20 19:29:28

	Always go into bypass mode when we have a rint_bypass handler.

Affected files ...

.. //depot/projects/mpsafetty/sys/kern/tty.c#40 edit
.. //depot/projects/mpsafetty/sys/kern/tty_ttydisc.c#23 edit

Differences ...

==== //depot/projects/mpsafetty/sys/kern/tty.c#40 (text+ko) ====

@@ -1697,6 +1697,9 @@
 	*rtp = tp;
 	error = 0;
 
+	/* Maybe we can switch into bypass mode now. */
+	ttydisc_optimize(tp);
+
 done3:	tty_unlock(tp);
 done2:	dev_relthread(dev);
 done1:	fdrop(fp, td);
@@ -1714,6 +1717,9 @@
 	tp->t_flags &= ~TF_HOOK;
 	tp->t_hook = NULL;
 
+	/* Maybe we need to leave bypass mode. */
+	ttydisc_optimize(tp);
+
 	/* Maybe deallocate the TTY as well. */
 	tty_rel_free(tp);
 }

==== //depot/projects/mpsafetty/sys/kern/tty_ttydisc.c#23 (text+ko) ====

@@ -562,11 +562,12 @@
 {
 	tty_lock_assert(tp, MA_OWNED);
 
-	if (!CMP_FLAG(i, ICRNL|IGNCR|IMAXBEL|INLCR|ISTRIP|IXON) &&
+	if ((!CMP_FLAG(i, ICRNL|IGNCR|IMAXBEL|INLCR|ISTRIP|IXON) &&
 	    (!CMP_FLAG(i, BRKINT) || CMP_FLAG(i, IGNBRK)) &&
 	    (!CMP_FLAG(i, PARMRK) ||
 	        CMP_FLAG(i, IGNPAR|IGNBRK) == (IGNPAR|IGNBRK)) &&
-	    !CMP_FLAG(l, ECHO|ICANON|IEXTEN|ISIG|PENDIN)) {
+	    !CMP_FLAG(l, ECHO|ICANON|IEXTEN|ISIG|PENDIN)) ||
+	    ttyhook_hashook(tp, rint_bypass)) {
 		tp->t_flags |= TF_BYPASS;
 	} else {
 		tp->t_flags &= ~TF_BYPASS;


More information about the p4-projects mailing list