| Index: base/process_util_posix.cc
|
| diff --git a/base/process_util_posix.cc b/base/process_util_posix.cc
|
| index 562b8e908f999f0550ede140952ab6f3a7cf9574..2e3fd554a1db9a9acba5d6988022b02c9fd65f56 100644
|
| --- a/base/process_util_posix.cc
|
| +++ b/base/process_util_posix.cc
|
| @@ -22,6 +22,7 @@
|
| #include "base/scoped_ptr.h"
|
| #include "base/sys_info.h"
|
| #include "base/time.h"
|
| +#include "base/waitable_event.h"
|
|
|
| const int kMicrosecondsPerSecond = 1000000;
|
|
|
| @@ -207,7 +208,7 @@ int WaitpidWithTimeout(ProcessHandle handle, int wait_milliseconds,
|
| // has been installed. This means that when a SIGCHLD is sent, it will exit
|
| // depending on behavior external to this function.
|
| //
|
| - // This function is used primarilly for unit tests, if we want to use it in
|
| + // This function is used primarily for unit tests, if we want to use it in
|
| // the application itself it would probably be best to examine other routes.
|
| int status = -1;
|
| pid_t ret_pid = waitpid(handle, &status, WNOHANG);
|
| @@ -243,7 +244,11 @@ int WaitpidWithTimeout(ProcessHandle handle, int wait_milliseconds,
|
|
|
| bool WaitForSingleProcess(ProcessHandle handle, int wait_milliseconds) {
|
| bool waitpid_success;
|
| - int status = WaitpidWithTimeout(handle, wait_milliseconds, &waitpid_success);
|
| + int status;
|
| + if (wait_milliseconds == base::kNoTimeout)
|
| + waitpid_success = (waitpid(handle, &status, 0) != -1);
|
| + else
|
| + status = WaitpidWithTimeout(handle, wait_milliseconds, &waitpid_success);
|
| if (status != -1) {
|
| DCHECK(waitpid_success);
|
| return WIFEXITED(status);
|
|
|