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>maint
parent
52de4db579
commit
ef7108caf3
|
@ -1554,6 +1554,14 @@ pid_t waitpid(pid_t pid, int *status, unsigned options)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pid > 0 && options & WNOHANG) {
|
||||||
|
if (WAIT_OBJECT_0 != WaitForSingleObject(h, 0)) {
|
||||||
|
CloseHandle(h);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
options &= ~WNOHANG;
|
||||||
|
}
|
||||||
|
|
||||||
if (options == 0) {
|
if (options == 0) {
|
||||||
struct pinfo_t **ppinfo;
|
struct pinfo_t **ppinfo;
|
||||||
if (WaitForSingleObject(h, INFINITE) != WAIT_OBJECT_0) {
|
if (WaitForSingleObject(h, INFINITE) != WAIT_OBJECT_0) {
|
||||||
|
|
|
@ -140,6 +140,7 @@ static inline int mingw_unlink(const char *pathname)
|
||||||
}
|
}
|
||||||
#define unlink mingw_unlink
|
#define unlink mingw_unlink
|
||||||
|
|
||||||
|
#define WNOHANG 1
|
||||||
pid_t waitpid(pid_t pid, int *status, unsigned options);
|
pid_t waitpid(pid_t pid, int *status, unsigned options);
|
||||||
|
|
||||||
#ifndef NO_OPENSSL
|
#ifndef NO_OPENSSL
|
||||||
|
|
Loading…
Reference in New Issue