From owner-svn-src-head@FreeBSD.ORG Sun Sep 19 15:36:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1451A106566B; Sun, 19 Sep 2010 15:36:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id A102E8FC1B; Sun, 19 Sep 2010 15:36:39 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o8JFaOuZ072163 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 19 Sep 2010 18:36:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o8JFaONx044060; Sun, 19 Sep 2010 18:36:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o8JFaOGL044059; Sun, 19 Sep 2010 18:36:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 19 Sep 2010 18:36:24 +0300 From: Kostik Belousov To: Ed Schouten Message-ID: <20100919153624.GD2389@deviant.kiev.zoral.com.ua> References: <201009191421.o8JELdNY004586@svn.freebsd.org> <20100919143047.GB2389@deviant.kiev.zoral.com.ua> <20100919150628.GN56986@hoeg.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Rln2GmQ7CFmDhc9B" Content-Disposition: inline In-Reply-To: <20100919150628.GN56986@hoeg.nl> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.1 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r212860 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 15:36:40 -0000 --Rln2GmQ7CFmDhc9B Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Sep 19, 2010 at 05:06:28PM +0200, Ed Schouten wrote: > * Kostik Belousov wrote: > > Shouldn't you always report CLOCAL for console then ? >=20 > Hmmm... That would be a lot more elegant, also for callout devices. The > change I just committed, doesn't take a loss of SER_DCD into account > after opening the device. >=20 > Any comments on the following patch? It looks very similar to what I proposed. Thanks. >=20 > %%% > Index: sys/kern/tty.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/kern/tty.c (revision 212860) > +++ sys/kern/tty.c (working copy) > @@ -263,12 +263,14 @@ > =20 > if (!tty_opened(tp)) { > /* Set proper termios flags. */ > - if (TTY_CALLOUT(tp, dev)) { > + if (TTY_CALLOUT(tp, dev)) > tp->t_termios =3D tp->t_termios_init_out; > - } else { > + else > tp->t_termios =3D tp->t_termios_init_in; > - } > ttydevsw_param(tp, &tp->t_termios); > + /* Prevent modem control on callout devices and /dev/console. */ > + if (TTY_CALLOUT(tp, dev) || dev =3D=3D dev_console) > + tp->t_termios.c_cflag |=3D CLOCAL; > =20 > ttydevsw_modem(tp, SER_DTR|SER_RTS, 0); > =20 > @@ -281,9 +283,8 @@ > } > =20 > /* Wait for Carrier Detect. */ > - if (!TTY_CALLOUT(tp, dev) && (oflags & O_NONBLOCK) =3D=3D 0 && > - (tp->t_termios.c_cflag & CLOCAL) =3D=3D 0 && > - dev !=3D dev_console) { > + if ((oflags & O_NONBLOCK) =3D=3D 0 && > + (tp->t_termios.c_cflag & CLOCAL) =3D=3D 0) { > while ((ttydevsw_modem(tp, 0, 0) & SER_DCD) =3D=3D 0) { > error =3D tty_wait(tp, &tp->t_dcdwait); > if (error !=3D 0) > %%% >=20 > --=20 > Ed Schouten > WWW: http://80386.nl/ --Rln2GmQ7CFmDhc9B Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkyWLfcACgkQC3+MBN1Mb4i0nwCeP+3QoGQfJ+PaCcY7vm64OVft pGcAnjXKaxDGDazl3bmpPSTyVeQxOwN5 =TpEh -----END PGP SIGNATURE----- --Rln2GmQ7CFmDhc9B--