Commit e6b1e558aca0e065a674f580d5347e5714da345f

Authored by ths
1 parent 095f61d2

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
Showing 1 changed file with 18 additions and 3 deletions
... ... @@ -6143,7 +6143,7 @@ void main_loop_wait(int timeout)
6143 6143 {
6144 6144 IOHandlerRecord *ioh;
6145 6145 fd_set rfds, wfds, xfds;
6146   - int ret, nfds;
  6146 + int ret, ret2, nfds, i;
6147 6147 struct timeval tv;
6148 6148 PollingEntry *pe;
6149 6149  
... ... @@ -6154,7 +6154,7 @@ void main_loop_wait(int timeout)
6154 6154 ret |= pe->func(pe->opaque);
6155 6155 }
6156 6156 #ifdef _WIN32
6157   - if (ret == 0 && timeout > 0) {
  6157 + if (ret == 0) {
6158 6158 int err;
6159 6159 WaitObjects *w = &wait_objects;
6160 6160  
... ... @@ -6162,10 +6162,25 @@ void main_loop_wait(int timeout)
6162 6162 if (WAIT_OBJECT_0 + 0 <= ret && ret <= WAIT_OBJECT_0 + w->num - 1) {
6163 6163 if (w->func[ret - WAIT_OBJECT_0])
6164 6164 w->func[ret - WAIT_OBJECT_0](w->opaque[ret - WAIT_OBJECT_0]);
  6165 +
  6166 + /* Check for additional signaled events */
  6167 + for(i = (ret - WAIT_OBJECT_0 + 1); i < w->num; i++) {
  6168 +
  6169 + /* Check if event is signaled */
  6170 + ret2 = WaitForSingleObject(w->events[i], 0);
  6171 + if(ret2 == WAIT_OBJECT_0) {
  6172 + if (w->func[i])
  6173 + w->func[i](w->opaque[i]);
  6174 + } else if (ret2 == WAIT_TIMEOUT) {
  6175 + } else {
  6176 + err = GetLastError();
  6177 + fprintf(stderr, "WaitForSingleObject error %d %d\n", i, err);
  6178 + }
  6179 + }
6165 6180 } else if (ret == WAIT_TIMEOUT) {
6166 6181 } else {
6167 6182 err = GetLastError();
6168   - fprintf(stderr, "Wait error %d %d\n", ret, err);
  6183 + fprintf(stderr, "WaitForMultipleObjects error %d %d\n", ret, err);
6169 6184 }
6170 6185 }
6171 6186 #endif
... ...