aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2006-11-01 01:44:16 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2006-11-01 01:44:16 +0000
commit188157fe87f24fc4200deba17bb258ec5ddb6ca1 (patch)
tree784a872ab7dff8aacd3942288b77e7445edb92b6
parent58126404f5d8ccb53ab7a385ad0230dd7c4cc130 (diff)
Remove FD on close.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2207 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 d047eb4200..447da38a94 100644
--- a/vl.c
+++ b/vl.c
@@ -1228,6 +1228,11 @@ static void fd_chr_read(void *opaque)
if (len == 0)
return;
size = read(s->fd_in, buf, len);
+ if (size == 0) {
+ /* FD has been closed. Remove it from the active list. */
+ qemu_set_fd_handler2(s->fd_in, NULL, NULL, NULL, NULL);
+ return;
+ }
if (size > 0) {
s->fd_read(s->fd_opaque, buf, size);
}