WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] PATCH [xenconsoled]: makes pty slave raw early

To: tgingold@xxxxxxx
Subject: Re: [Xen-devel] PATCH [xenconsoled]: makes pty slave raw early
From: John Levon <levon@xxxxxxxxxxxxxxxxx>
Date: Wed, 16 Jan 2008 10:58:53 +0000
Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 16 Jan 2008 02:59:50 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20080116053004.GA18526@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20080116053004.GA18526@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
On Wed, Jan 16, 2008 at 06:30:04AM +0100, tgingold@xxxxxxx wrote:

> diff -r ca2828a46217 -r 0353ead264ba tools/console/daemon/io.c
> --- a/tools/console/daemon/io.c       Wed Jan 16 06:21:50 2008 +0100
> +++ b/tools/console/daemon/io.c       Wed Jan 16 06:25:43 2008 +0100
> @@ -278,8 +278,10 @@ static int openpty(int *amaster, int *as
>       if (winp)
>               ioctl(sfd, TIOCSWINSZ, winp);
>  
> +     if (termp)
> +             tcsetattr(sfd, TCSAFLUSH, termp);
> +

This is wrong. openpty() only retrieves term settings, not sets it. You
must do the cfmakeraw after openpty().

Also, if you're re-introducing cfmakeraw() call, you need to include
this:

#ifdef  __sun__
void cfmakeraw (struct termios *termios_p)
{
        termios_p->c_iflag &=
            ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
        termios_p->c_oflag &= ~OPOST;
        termios_p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
        termios_p->c_cflag &= ~(CSIZE|PARENB);
        termios_p->c_cflag |= CS8;

        termios_p->c_cc[VMIN] = 0;
        termios_p->c_cc[VTIME] = 0;
}
#endif


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel