Bug 950401 - Add process logging to OS X / BSD. r=bsmedberg

MozReview-Commit-ID: bEPQabbSP1

--HG--
extra : rebase_source : 115312fdb0f29a5914c5dcccb9d7ba7eae943ce0
This commit is contained in:
Henrik Skupin 2016-06-03 18:26:15 +02:00
parent faf31d5017
commit 73b62156c7
2 changed files with 16 additions and 0 deletions

View File

@ -17,6 +17,12 @@
#include "nspr.h"
#include "base/eintr_wrapper.h"
namespace {
static mozilla::EnvironmentLog gProcessLog("MOZ_PROCESS_LOG");
} // namespace
namespace base {
void FreeEnvVarsArray(char* array[], int length)
@ -135,6 +141,8 @@ bool LaunchApp(const std::vector<std::string>& argv,
if (!spawn_succeeded || !process_handle_valid) {
retval = false;
} else {
gProcessLog.print("==> process %d launched child process %d\n",
GetCurrentProcId(), pid);
if (wait)
HANDLE_EINTR(waitpid(pid, 0, 0));

View File

@ -18,6 +18,12 @@
#include "base/string_util.h"
#include "base/time.h"
namespace {
static mozilla::EnvironmentLog gProcessLog("MOZ_PROCESS_LOG");
} // namespace
namespace base {
void FreeEnvVarsArray(char* array[], int length)
@ -170,6 +176,8 @@ bool LaunchApp(const std::vector<std::string>& argv,
if (!spawn_succeeded || !process_handle_valid) {
retval = false;
} else {
gProcessLog.print("==> process %d launched child process %d\n",
GetCurrentProcId(), pid);
if (wait)
HANDLE_EINTR(waitpid(pid, 0, 0));