diff options
author | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-04-18 17:56:02 +0000 |
---|---|---|
committer | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-04-18 17:56:02 +0000 |
commit | e6b1e558aca0e065a674f580d5347e5714da345f (patch) | |
tree | 0fc99ad706363608e9dc3d487bcbf7d642cd8883 | |
parent | 095f61d202ef65e8efa88d98c87759bac420dbe3 (diff) |
Win32 Tap inferface PPC Guest issue, by Ely Soto.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2701 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r-- | vl.c | 21 |
1 files changed, 18 insertions, 3 deletions
@@ -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 |