aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/vl.c b/vl.c
index 45e9417..d422fed 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]);
}