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-changelog

[Xen-changelog] Make the master fd belonging to the pty pair non-blockin

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Make the master fd belonging to the pty pair non-blocking. Writes were blocking
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 07 Dec 2005 14:20:06 +0000
Delivery-date: Wed, 07 Dec 2005 16:59:17 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 95584b819b72a87775584323b27731ddab7111f2
# Parent  1e6fa31fb7801502e0d517d9f30e4cef96d1d5a1
Make the master fd belonging to the pty pair non-blocking.  Writes were blocking
if the console client disconnected before all the data had been written to the
pty, even though the select call had indicated that the fd was previously
writable.  Reads have been observed exhibiting similar behaviour too.

Closes bug #380.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r 1e6fa31fb780 -r 95584b819b72 tools/console/daemon/io.c
--- a/tools/console/daemon/io.c Mon Dec  5 15:36:11 2005
+++ b/tools/console/daemon/io.c Tue Dec  6 16:40:43 2005
@@ -180,6 +180,9 @@
                free(path);
                if (!success)
                        goto out;
+
+               if (fcntl(master, F_SETFL, O_NONBLOCK) == -1)
+                       goto out;
        }
 
        return master;

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

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