| Index: base/process_util_posix.cc
|
| ===================================================================
|
| --- base/process_util_posix.cc (revision 14443)
|
| +++ base/process_util_posix.cc (working copy)
|
| @@ -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 @@
|
| // 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 @@
|
|
|
| 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);
|
|
|