aboutsummaryrefslogtreecommitdiffstats
path: root/tools/console
diff options
context:
space:
mode:
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>2005-12-06 16:40:43 +0000
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>2005-12-06 16:40:43 +0000
commite50a8e993968af639b8941e3d6c18cd7154b5500 (patch)
tree3b4042e0fd4cac4f9180a334761d5f70cde5b6bd /tools/console
parent383dbc16f4d92cf8430ccd82f2e61527d17ca299 (diff)
downloadxen-e50a8e993968af639b8941e3d6c18cd7154b5500.tar.gz
xen-e50a8e993968af639b8941e3d6c18cd7154b5500.tar.bz2
xen-e50a8e993968af639b8941e3d6c18cd7154b5500.zip
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@xensource.com>
Diffstat (limited to 'tools/console')
-rw-r--r--tools/console/daemon/io.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
index a26a6560dc..1b49f20c23 100644
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -180,6 +180,9 @@ static int domain_create_tty(struct domain *dom)
free(path);
if (!success)
goto out;
+
+ if (fcntl(master, F_SETFL, O_NONBLOCK) == -1)
+ goto out;
}
return master;