2010-02-06 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / io-layer / wait.c
index 26fd6e8f476bc70c81507c1e8b087bada849b0e9..db008cc1f87a0b910254bd82997650ddc1196bb7 100644 (file)
@@ -12,7 +12,7 @@
 #include <string.h>
 #include <errno.h>
 
-#include <mono/os/gc_wrapper.h>
+#include <mono/utils/gc_wrapper.h>
 
 #include <mono/io-layer/wapi.h>
 #include <mono/io-layer/handles-private.h>
@@ -627,6 +627,7 @@ guint32 WaitForMultipleObjectsEx(guint32 numobjects, gpointer *handles,
 #endif
 
                        bogustype = TRUE;
+                       break;
                }
 
                g_hash_table_insert (dups, handles[i], handles[i]);
@@ -650,6 +651,7 @@ guint32 WaitForMultipleObjectsEx(guint32 numobjects, gpointer *handles,
                return(WAIT_FAILED);
        }
 
+       poll = FALSE;
        for (i = 0; i < numobjects; ++i)
                if (_wapi_handle_type (handles [i]) == WAPI_HANDLE_PROCESS)
                        /* Can't wait for a process handle + another handle without polling */