Win32 Tap inferface PPC Guest issue, by Ely Soto.
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
Wed, 18 Apr 2007 17:56:02 +0000 (17:56 +0000)
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
Wed, 18 Apr 2007 17:56:02 +0000 (17:56 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2701 c046a42c-6fe2-441c-8c8c-71466251a162

vl.c

diff --git a/vl.c b/vl.c
index 1c79cfd..ab7aacf 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -6143,7 +6143,7 @@ void main_loop_wait(int timeout)
 {
     IOHandlerRecord *ioh;
     fd_set rfds, wfds, xfds;
-    int ret, nfds;
+    int ret, ret2, nfds, i;
     struct timeval tv;
     PollingEntry *pe;
 
@@ -6154,7 +6154,7 @@ void main_loop_wait(int timeout)
         ret |= pe->func(pe->opaque);
     }
 #ifdef _WIN32
-    if (ret == 0 && timeout > 0) {
+    if (ret == 0) {
         int err;
         WaitObjects *w = &wait_objects;
         
@@ -6162,10 +6162,25 @@ void main_loop_wait(int timeout)
         if (WAIT_OBJECT_0 + 0 <= ret && ret <= WAIT_OBJECT_0 + w->num - 1) {
             if (w->func[ret - WAIT_OBJECT_0])
                 w->func[ret - WAIT_OBJECT_0](w->opaque[ret - WAIT_OBJECT_0]);
+                
+            /* Check for additional signaled events */ 
+            for(i = (ret - WAIT_OBJECT_0 + 1); i < w->num; i++) {
+                                
+                /* Check if event is signaled */
+                ret2 = WaitForSingleObject(w->events[i], 0);
+                if(ret2 == WAIT_OBJECT_0) {
+                    if (w->func[i])
+                        w->func[i](w->opaque[i]);
+                } else if (ret2 == WAIT_TIMEOUT) {
+                } else {
+                    err = GetLastError();
+                    fprintf(stderr, "WaitForSingleObject error %d %d\n", i, err);
+                }                
+            }                 
         } else if (ret == WAIT_TIMEOUT) {
         } else {
             err = GetLastError();
-            fprintf(stderr, "Wait error %d %d\n", ret, err);
+            fprintf(stderr, "WaitForMultipleObjects error %d %d\n", ret, err);
         }
     }
 #endif