From 4e35af6bee7114adc10b257a192795220dde7982 Mon Sep 17 00:00:00 2001 From: pbrook Date: Sun, 10 Sep 2006 14:39:54 +0000 Subject: [PATCH] Avoid (repeatedly) trying to read stdin after it has closed. --- vl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vl.c b/vl.c index 45e9417f..d422fedc 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]); } -- 2.39.5