From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Thibault Subject: Re: [PATCH] Fix xenconsole's "Could not read tty from store" Date: Tue, 18 Dec 2007 17:03:59 +0000 Message-ID: <20071218170359.GO4244@implementation.uk.xensource.com> References: <20071217112254.GA5240@implementation.uk.xensource.com> <20071217164246.GF4172@totally.trollied.org.uk> <20071217165401.GS4614@implementation.uk.xensource.com> <20071218014144.GA8068@totally.trollied.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Return-path: Content-Disposition: inline In-Reply-To: <20071218014144.GA8068@totally.trollied.org.uk> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: John Levon Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Oops, there may be a problem with this: John Levon, le Tue 18 Dec 2007 01:41:44 +0000, a écrit : > @@ -684,7 +720,9 @@ static void handle_tty_read(struct domai > len = sizeof(msg); > > len = read(dom->tty_fd, msg, len); > - if (len < 1) { > + if (len == 0) { > + /* slave did a close: that's fine. */ > + } else if (len < 0) { > close(dom->tty_fd); > dom->tty_fd = -1; > If the slave did a close, you have to somehow remove the fd from the select, because else you'll loop trying to read EOF. Samuel