aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/mingw.h2
-rw-r--r--win32/process.c4
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
343int waitpid(pid_t pid, int *status, unsigned options); 343int 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
4int waitpid(pid_t pid, int *status, unsigned options) 4int 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);