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

Unified Diff: base/process_util_posix.cc

Issue 99008: Port unload_uitest.cc and enable some of the tests on linux.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' 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/unload_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | chrome/browser/unload_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698