aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2006-09-10 14:39:54 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2006-09-10 14:39:54 +0000
commit519945dfbe270059cf012863b97343c752f634cf (patch)
treef6fd0cddfbe98c38daa2cc01da757d7424e0d90c
parent707b3ee068a1324b708f6dd707cc156a0b8de371 (diff)
Avoid (repeatedly) trying to read stdin after it has closed.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2156 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--vl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/vl.c b/vl.c
index 45e9417f21..d422fedcf0 100644
--- a/vl.c
+++ b/vl.c
@@ -1417,6 +1417,11 @@ static void stdio_read(void *opaque)
uint8_t buf[1];
size = read(0, buf, 1);
+ if (size == 0) {
+ /* stdin has been closed. Remove it from the active list. */
+ qemu_set_fd_handler2(0, NULL, NULL, NULL, NULL);
+ return;
+ }
if (size > 0)
stdio_received_byte(buf[0]);
}