From: John Levon Subject: Re: PATCH [xenconsoled]: makes pty slave raw early Date: Wed, 16 Jan 2008 10:58:53 +0000 Message-ID: <20080116105853.GA26724@totally.trollied.org.uk> References: <20080116053004.GA18526@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20080116053004.GA18526@localhost.localdomain> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: tgingold@free.fr Cc: Xen-devel List-Id: xen-devel@lists.xenproject.org On Wed, Jan 16, 2008 at 06:30:04AM +0100, tgingold@free.fr 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