diff --git a/ipc/chromium/src/chrome/common/process_watcher_posix_sigchld.cc b/ipc/chromium/src/chrome/common/process_watcher_posix_sigchld.cc index a79aca8040da..31eef5faf2e7 100644 --- a/ipc/chromium/src/chrome/common/process_watcher_posix_sigchld.cc +++ b/ipc/chromium/src/chrome/common/process_watcher_posix_sigchld.cc @@ -81,22 +81,6 @@ IsProcessDead(pid_t process) return exited; } -bool -WaitForProcessExitMaxSecs(pid_t process, int maxSecs) -{ - bool infiniteWait = (maxSecs < 0); - int status; - int nWaits = 0; - - do { - HANDLE_EINTR(waitpid(process, &status, WNOHANG)); - } while (!WIFEXITED(status) && - (infiniteWait || nWaits++ < maxSecs) && - 0 == HANDLE_EINTR(sleep(1))); - - return WIFEXITED(status); -} - class ChildReaper : public base::MessagePumpLibevent::SignalEvent, public base::MessagePumpLibevent::SignalWatcher @@ -142,16 +126,20 @@ protected: HANDLE_EINTR(waitpid(process_, NULL, 0)); #else - if (WaitForProcessExitMaxSecs(process_, 30)) { - printf("TEST-UNEXPECTED-FAIL | process %d done busy-waiting on | child process %d exited normally\n", getpid(), process_); - return; + const int maxWaits = 30; + int waits = 0; + while (!IsProcessDead(process_) && ++waits < maxWaits) + sleep(1); + + if (waits < maxWaits) { + printf("TEST-UNEXPECTED-FAIL | process %d done busy-waiting on | child process %d\n", getpid(), process_); + } + else { + printf("TEST-UNEXPECTED-FAIL | process %d wait on | child process %d timed out!\n", getpid(), process_); + // kill the child in such a way that breakpad is triggered + kill(process_, SIGSEGV); + HANDLE_EINTR(waitpid(process_, NULL, 0)); } - - printf("TEST-UNEXPECTED-FAIL | process %d wait on | child process %d timed out!\n", getpid(), process_); - // kill the child in such a way that breakpad is triggered - kill(process_, SIGSEGV); - - WaitForProcessExitMaxSecs(process_, -1); // wait "forever" #endif diff --git a/toolkit/crashreporter/nsExceptionHandler.cpp b/toolkit/crashreporter/nsExceptionHandler.cpp index e75ba5e177aa..f11e5afb9568 100644 --- a/toolkit/crashreporter/nsExceptionHandler.cpp +++ b/toolkit/crashreporter/nsExceptionHandler.cpp @@ -1048,15 +1048,6 @@ OnChildProcessDumpRequested(void* aContext, pid = aClientInfo->pid_; #endif - - -#ifdef XP_LINUX - printf("TEST-UNEXPECTED-FAIL | got minidump at | %s\n", aFilePath->c_str()); -#endif - - - - // Get an .extra file with the same base name as the .dmp file nsCOMPtr extraFile; nsresult rv = lf->Clone(getter_AddRefs(extraFile)); @@ -1077,14 +1068,6 @@ OnChildProcessDumpRequested(void* aContext, // Now write out the annotations to it nsCOMPtr stream = do_CreateInstance("@mozilla.org/network/file-output-stream;1"); - - - - if (!stream) - return; - - - rv = stream->Init(extraFile, -1, 0600, 0); if (NS_FAILED(rv)) return;