Fix monitor command (screendump) (Stefan Weil)
[qemu] / aio.c
diff --git a/aio.c b/aio.c
index 687e4be..200320c 100644 (file)
--- a/aio.c
+++ b/aio.c
@@ -79,8 +79,6 @@ int qemu_aio_set_fd_handler(int fd,
         if (node == NULL) {
             /* Alloc and insert if it's not already there */
             node = qemu_mallocz(sizeof(AioHandler));
-            if (node == NULL)
-                return -ENOMEM;
             node->fd = fd;
             LIST_INSERT_HEAD(&aio_handlers, node, node);
         }
@@ -126,6 +124,9 @@ void qemu_aio_wait(void)
 
         walking_handlers = 1;
 
+        FD_ZERO(&rdfds);
+        FD_ZERO(&wrfds);
+
         /* fill fd sets */
         LIST_FOREACH(node, &aio_handlers, node) {
             /* If there aren't pending AIO operations, don't invoke callbacks.