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

Unified Diff: base/process_util_posix.cc

Issue 6689014: GTTF: Detect browser crashes on shutdown in UI tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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
Index: base/process_util_posix.cc
===================================================================
--- base/process_util_posix.cc (revision 80488)
+++ base/process_util_posix.cc (working copy)
@@ -724,14 +724,15 @@
return false;
if (!waitpid_success)
return false;
- if (!WIFEXITED(status))
- return false;
if (WIFSIGNALED(status)) {
*exit_code = -1;
return true;
}
- *exit_code = WEXITSTATUS(status);
- return true;
+ if (WIFEXITED(status)) {
+ *exit_code = WEXITSTATUS(status);
+ return true;
+ }
+ return false;
}
#if defined(OS_MACOSX)
@@ -821,19 +822,6 @@
}
}
-bool CrashAwareSleep(ProcessHandle handle, int64 wait_milliseconds) {
- bool waitpid_success;
- int status = WaitpidWithTimeout(handle, wait_milliseconds, &waitpid_success);
- if (status != -1) {
- DCHECK(waitpid_success);
- return !(WIFEXITED(status) || WIFSIGNALED(status));
- } else {
- // If waitpid returned with an error, then the process doesn't exist
- // (which most probably means it didn't exist before our call).
- return waitpid_success;
- }
-}
-
int64 TimeValToMicroseconds(const struct timeval& tv) {
static const int kMicrosecondsPerSecond = 1000000;
int64 ret = tv.tv_sec; // Avoid (int * int) integer overflow.

Powered by Google App Engine
This is Rietveld 408576698