summaryrefslogtreecommitdiff
path: root/compat/mingw.c
diff options
context:
space:
mode:
Diffstat (limited to 'compat/mingw.c')
-rw-r--r--compat/mingw.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index 736d03fa0c..47a0e8861d 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1554,6 +1554,14 @@ pid_t waitpid(pid_t pid, int *status, unsigned options)
return -1;
}
+ if (pid > 0 && options & WNOHANG) {
+ if (WAIT_OBJECT_0 != WaitForSingleObject(h, 0)) {
+ CloseHandle(h);
+ return 0;
+ }
+ options &= ~WNOHANG;
+ }
+
if (options == 0) {
struct pinfo_t **ppinfo;
if (WaitForSingleObject(h, INFINITE) != WAIT_OBJECT_0) {