]> xenbits.xensource.com Git - qemu-xen-4.0-testing.git/commitdiff
Remove FD on close.
authorpbrook <pbrook>
Wed, 1 Nov 2006 01:44:16 +0000 (01:44 +0000)
committerpbrook <pbrook>
Wed, 1 Nov 2006 01:44:16 +0000 (01:44 +0000)
vl.c

diff --git a/vl.c b/vl.c
index d047eb4200852ef5c839a39c9c18a888531522ee..447da38a949d44469105cbd44ee67f83f581170d 100644 (file)
--- 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);
     }