Index: tap-win32.c
===================================================================
RCS file: /sources/qemu/qemu/tap-win32.c,v
retrieving revision 1.2
diff -u -r1.2 tap-win32.c
--- tap-win32.c	19 Feb 2006 12:40:00 -0000	1.2
+++ tap-win32.c	7 Mar 2006 04:18:44 -0000
@@ -642,7 +642,7 @@
 }
 
 /* XXX: horrible, suppress this by using proper thread signaling */
-void tap_win32_poll(void)
+int tap_win32_poll(void)
 {
     TAPState *s = tap_win32_state;
     uint8_t *buf;
@@ -650,13 +650,14 @@
     int size;
 
     if (!s)
-        return;
+        return -1;
 
     size = tap_win32_read(s->handle, &buf, max_size);
     if (size > 0) {
         qemu_send_packet(s->vc, buf, size);
         tap_win32_free_buffer(s->handle, buf);
     }
+    return size;
 }
 
 int tap_win32_init(VLANState *vlan, const char *ifname)
Index: vl.c
===================================================================
RCS file: /sources/qemu/qemu/vl.c,v
retrieving revision 1.165
diff -u -r1.165 vl.c
--- vl.c	20 Feb 2006 00:33:36 -0000	1.165
+++ vl.c	7 Mar 2006 04:18:49 -0000
@@ -3960,8 +3960,11 @@
 #ifdef _WIN32
     /* XXX: see how to merge it with the select. The constraint is
        that the select must be interrupted by the timer */
-    if (timeout > 0)
-        Sleep(timeout);
+    ret = tap_win32_poll();
+    if (ret <= 0) {
+        if (timeout > 0)
+            Sleep(timeout);
+    }
 #endif
     /* poll any events */
     /* XXX: separate device handlers from system ones */
@@ -4002,9 +4005,6 @@
             }
         }
     }
-#ifdef _WIN32
-    tap_win32_poll();
-#endif
 
 #if defined(CONFIG_SLIRP)
     /* XXX: merge with the previous select() */
Index: vl.h
===================================================================
RCS file: /sources/qemu/qemu/vl.h,v
retrieving revision 1.105
diff -u -r1.105 vl.h
--- vl.h	20 Feb 2006 00:33:36 -0000	1.105
+++ vl.h	7 Mar 2006 04:18:50 -0000
@@ -307,7 +307,7 @@
 
 /* TAP win32 */
 int tap_win32_init(VLANState *vlan, const char *ifname);
-void tap_win32_poll(void);
+int tap_win32_poll(void);
 
 /* NIC info */
 
