diff options
-rw-r--r-- | win32/process.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/win32/process.c b/win32/process.c index 462731a2d..dc9e98305 100644 --- a/win32/process.c +++ b/win32/process.c | |||
@@ -3,9 +3,18 @@ | |||
3 | 3 | ||
4 | int waitpid(pid_t pid, int *status, unsigned options) | 4 | int waitpid(pid_t pid, int *status, unsigned options) |
5 | { | 5 | { |
6 | HANDLE proc; | ||
7 | int ret; | ||
8 | |||
6 | /* Windows does not understand parent-child */ | 9 | /* Windows does not understand parent-child */ |
7 | if (options == 0 && pid != -1) | 10 | if (options == 0 && pid != -1) { |
8 | return _cwait(status, pid, 0); | 11 | if ( (proc=OpenProcess(SYNCHRONIZE|PROCESS_QUERY_INFORMATION, |
12 | FALSE, pid)) != NULL ) { | ||
13 | ret = _cwait(status, proc, 0); | ||
14 | CloseHandle(proc); | ||
15 | return ret; | ||
16 | } | ||
17 | } | ||
9 | errno = EINVAL; | 18 | errno = EINVAL; |
10 | return -1; | 19 | return -1; |
11 | } | 20 | } |