diff options
author | Ron Yorston <rmy@pobox.com> | 2015-05-29 15:33:23 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2015-05-29 15:33:23 +0100 |
commit | 0f08b401f107732d6c88486a739f26ce04578c34 (patch) | |
tree | 21551672eca72e1c0aef8c4749cd8598118a154c /win32 | |
parent | 29eacf8ce0ec56d4b4a8b03fb6a921b4843a9ee3 (diff) | |
download | busybox-w32-0f08b401f107732d6c88486a739f26ce04578c34.tar.gz busybox-w32-0f08b401f107732d6c88486a739f26ce04578c34.tar.bz2 busybox-w32-0f08b401f107732d6c88486a739f26ce04578c34.zip |
mingw: fixes to implementation of waitpid(2)
The third argument should be int. We only support positive pid
values.
Diffstat (limited to 'win32')
-rw-r--r-- | win32/process.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/win32/process.c b/win32/process.c index 318515375..e38792b5a 100644 --- a/win32/process.c +++ b/win32/process.c | |||
@@ -1,13 +1,13 @@ | |||
1 | #include "libbb.h" | 1 | #include "libbb.h" |
2 | #include <tlhelp32.h> | 2 | #include <tlhelp32.h> |
3 | 3 | ||
4 | int waitpid(pid_t pid, int *status, unsigned options) | 4 | int waitpid(pid_t pid, int *status, int options) |
5 | { | 5 | { |
6 | HANDLE proc; | 6 | HANDLE proc; |
7 | int ret; | 7 | int ret; |
8 | 8 | ||
9 | /* Windows does not understand parent-child */ | 9 | /* Windows does not understand parent-child */ |
10 | if (options == 0 && pid != -1) { | 10 | if (pid > 0 && options == 0) { |
11 | if ( (proc=OpenProcess(SYNCHRONIZE|PROCESS_QUERY_INFORMATION, | 11 | if ( (proc=OpenProcess(SYNCHRONIZE|PROCESS_QUERY_INFORMATION, |
12 | FALSE, pid)) != NULL ) { | 12 | FALSE, pid)) != NULL ) { |
13 | ret = _cwait(status, proc, 0); | 13 | ret = _cwait(status, proc, 0); |