From 0f08b401f107732d6c88486a739f26ce04578c34 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Fri, 29 May 2015 15:33:23 +0100 Subject: mingw: fixes to implementation of waitpid(2) The third argument should be int. We only support positive pid values. --- include/mingw.h | 2 +- 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); */ #define WNOHANG 1 #define WUNTRACED 2 -int waitpid(pid_t pid, int *status, unsigned options); +int waitpid(pid_t pid, int *status, int options); /* * 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 @@ #include "libbb.h" #include -int waitpid(pid_t pid, int *status, unsigned options) +int waitpid(pid_t pid, int *status, int options) { HANDLE proc; int ret; /* Windows does not understand parent-child */ - if (options == 0 && pid != -1) { + if (pid > 0 && options == 0) { if ( (proc=OpenProcess(SYNCHRONIZE|PROCESS_QUERY_INFORMATION, FALSE, pid)) != NULL ) { ret = _cwait(status, proc, 0); -- cgit v1.2.3-55-g6feb