summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 52de4db)
raw | patch | inline | side by side (parent: 52de4db)
author | Erik Faye-Lund <kusmabite@gmail.com> | |
Thu, 4 Nov 2010 01:35:14 +0000 (02:35 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 4 Nov 2010 23:53:50 +0000 (16:53 -0700) |
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.c | patch | blob | history | |
compat/mingw.h | patch | blob | history |
diff --git a/compat/mingw.c b/compat/mingw.c
index 736d03fa0c3b61163325d9ef6933111e4ef2e656..47a0e8861dd5d55a77b3476119ee5504fc922126 100644 (file)
--- a/compat/mingw.c
+++ b/compat/mingw.c
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) {
diff --git a/compat/mingw.h b/compat/mingw.h
index 7c4eeea38cd52bc6b719758f6346c0b9dcb96220..379d7bff2cf35ad0829dbf7a0a5cc27986d7578c 100644 (file)
--- a/compat/mingw.h
+++ b/compat/mingw.h
}
#define unlink mingw_unlink
+#define WNOHANG 1
pid_t waitpid(pid_t pid, int *status, unsigned options);
#ifndef NO_OPENSSL