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] Fix xenconsole's "Could not read tty from store"

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

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

<Prev in Thread] Current Thread [Next in Thread>