diff options
-rw-r--r-- | vl.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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); } |