summaryrefslogtreecommitdiff
path: root/compat/mingw.c
diff options
context:
space:
mode:
authorErik Faye-Lund <kusmabite@gmail.com>2010-11-04 01:35:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-11-04 23:53:50 (GMT)
commitef7108caf3cd200620000921f1b121f8c78d9d3b (patch)
treefa9cb9d2cd0972b4a381f41f5c6b4189b1e891b8 /compat/mingw.c
parent52de4db57977175c5ad1d6c3922e772d6de08496 (diff)
downloadgit-ef7108caf3cd200620000921f1b121f8c78d9d3b.zip
git-ef7108caf3cd200620000921f1b121f8c78d9d3b.tar.gz
git-ef7108caf3cd200620000921f1b121f8c78d9d3b.tar.bz2
mingw: support waitpid with pid > 0 and WNOHANG
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 736d03f..47a0e88 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) {