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. --- win32/process.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'win32') 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