svn commit: r212860 - head/sys/kern

Kostik Belousov kostikbel at gmail.com
Sun Sep 19 15:36:40 UTC 2010


On Sun, Sep 19, 2010 at 05:06:28PM +0200, Ed Schouten wrote:
> * Kostik Belousov <kostikbel at gmail.com> wrote:
> > Shouldn't you always report CLOCAL for console then ?
> 
> 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.
> 
> Any comments on the following patch?
It looks very similar to what I proposed.

Thanks.
> 
> %%%
> Index: sys/kern/tty.c
> ===================================================================
> --- sys/kern/tty.c	(revision 212860)
> +++ sys/kern/tty.c	(working copy)
> @@ -263,12 +263,14 @@
>  
>  	if (!tty_opened(tp)) {
>  		/* Set proper termios flags. */
> -		if (TTY_CALLOUT(tp, dev)) {
> +		if (TTY_CALLOUT(tp, dev))
>  			tp->t_termios = tp->t_termios_init_out;
> -		} else {
> +		else
>  			tp->t_termios = 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 == dev_console)
> +			tp->t_termios.c_cflag |= CLOCAL;
>  
>  		ttydevsw_modem(tp, SER_DTR|SER_RTS, 0);
>  
> @@ -281,9 +283,8 @@
>  	}
>  
>  	/* Wait for Carrier Detect. */
> -	if (!TTY_CALLOUT(tp, dev) && (oflags & O_NONBLOCK) == 0 &&
> -	    (tp->t_termios.c_cflag & CLOCAL) == 0 &&
> -	    dev != dev_console) {
> +	if ((oflags & O_NONBLOCK) == 0 &&
> +	    (tp->t_termios.c_cflag & CLOCAL) == 0) {
>  		while ((ttydevsw_modem(tp, 0, 0) & SER_DCD) == 0) {
>  			error = tty_wait(tp, &tp->t_dcdwait);
>  			if (error != 0)
> %%%
> 
> -- 
>  Ed Schouten <ed at 80386.nl>
>  WWW: http://80386.nl/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-head/attachments/20100919/70cbef36/attachment.pgp


More information about the svn-src-head mailing list