Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2987)

Unified Diff: base/process_util_posix.cc

Issue 100061: Revert r14620 which was a rollback of r14549 and r14508. This (Closed)
Patch Set: rebase Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/app_modal_dialog_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | chrome/browser/app_modal_dialog_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698