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
This commit is contained in:
parent
707b3ee068
commit
519945dfbe
5
vl.c
5
vl.c
@ -1417,6 +1417,11 @@ static void stdio_read(void *opaque)
|
|||||||
uint8_t buf[1];
|
uint8_t buf[1];
|
||||||
|
|
||||||
size = read(0, 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)
|
if (size > 0)
|
||||||
stdio_received_byte(buf[0]);
|
stdio_received_byte(buf[0]);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user