From owner-p4-projects@FreeBSD.ORG Sat Sep 20 19:29:55 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 46DAA106566C; Sat, 20 Sep 2008 19:29:55 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B7B51065675 for ; Sat, 20 Sep 2008 19:29:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id ED4F48FC14 for ; Sat, 20 Sep 2008 19:29:54 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id m8KJTsu8029004 for ; Sat, 20 Sep 2008 19:29:54 GMT (envelope-from ed@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id m8KJTstZ028998 for perforce@freebsd.org; Sat, 20 Sep 2008 19:29:54 GMT (envelope-from ed@FreeBSD.org) Date: Sat, 20 Sep 2008 19:29:54 GMT Message-Id: <200809201929.m8KJTstZ028998@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to ed@FreeBSD.org using -f From: Ed Schouten To: Perforce Change Reviews Cc: Subject: PERFORCE change 150174 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Sep 2008 19:29:55 -0000 http://perforce.freebsd.org/chv.cgi?CH=150174 Change 150174 by ed@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;