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 | |
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.
-rw-r--r-- | include/mingw.h | 2 | ||||
-rw-r--r-- | win32/process.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/include/mingw.h b/include/mingw.h index 7224ba50a..a32d78ad0 100644 --- a/include/mingw.h +++ b/include/mingw.h | |||
@@ -340,7 +340,7 @@ int setitimer(int type, struct itimerval *in, struct itimerval *out); | |||
340 | */ | 340 | */ |
341 | #define WNOHANG 1 | 341 | #define WNOHANG 1 |
342 | #define WUNTRACED 2 | 342 | #define WUNTRACED 2 |
343 | int waitpid(pid_t pid, int *status, unsigned options); | 343 | int waitpid(pid_t pid, int *status, int options); |
344 | 344 | ||
345 | /* | 345 | /* |
346 | * time.h | 346 | * time.h |
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); |