1 diff -Naur qemu-0.9.0.orig/vl.c qemu-0.9.0/vl.c
2 --- qemu-0.9.0.orig/vl.c 2007-04-18 19:31:13.000000000 +0200
3 +++ qemu-0.9.0/vl.c 2007-04-18 19:32:03.000000000 +0200
5 IOCanRWHandler *fd_read_poll;
23 ioh->fd_read = fd_read;
24 ioh->fd_write = fd_write;
32 void main_loop_wait(int timeout)
34 - IOHandlerRecord *ioh, *ioh_next;
35 + IOHandlerRecord *ioh;
36 fd_set rfds, wfds, xfds;
42 for(ioh = first_io_handler; ioh != NULL; ioh = ioh->next) {
46 (!ioh->fd_read_poll ||
47 ioh->fd_read_poll(ioh->opaque) != 0)) {
48 @@ -5897,9 +5900,11 @@
50 ret = select(nfds + 1, &rfds, &wfds, &xfds, &tv);
52 - /* XXX: better handling of removal */
53 - for(ioh = first_io_handler; ioh != NULL; ioh = ioh_next) {
54 - ioh_next = ioh->next;
55 + IOHandlerRecord **pioh;
57 + for(ioh = first_io_handler; ioh != NULL; ioh = ioh->next) {
60 if (FD_ISSET(ioh->fd, &rfds)) {
61 ioh->fd_read(ioh->opaque);
63 @@ -5907,6 +5912,17 @@
64 ioh->fd_write(ioh->opaque);
68 + /* remove deleted IO handlers */
69 + pioh = &first_io_handler;
79 #if defined(CONFIG_SLIRP)