зеркало из https://github.com/mozilla/pjs.git
Bug 383603 - Disable the crash-reporter hook entirely if MOZ_CRASHREPORTER_DISABLE is set, r=luser
This commit is contained in:
Родитель
08dfa66447
Коммит
19e2e811fe
|
@ -233,10 +233,14 @@ nsresult SetExceptionHandler(nsILocalFile* aXREDirectory,
|
|||
if (gExceptionHandler)
|
||||
return NS_ERROR_ALREADY_INITIALIZED;
|
||||
|
||||
const char *envvar = PR_GetEnv("MOZ_CRASHREPORTER_DISABLE");
|
||||
if (envvar && *envvar)
|
||||
return NS_OK;
|
||||
|
||||
// this environment variable prevents us from launching
|
||||
// the crash reporter client
|
||||
const char* noReportEnv = PR_GetEnv("MOZ_CRASHREPORTER_NO_REPORT");
|
||||
if (noReportEnv && *noReportEnv)
|
||||
envvar = PR_GetEnv("MOZ_CRASHREPORTER_NO_REPORT");
|
||||
if (envvar && *envvar)
|
||||
doReport = false;
|
||||
|
||||
// allocate our strings
|
||||
|
@ -428,6 +432,9 @@ nsresult AnnotateCrashReport(const nsACString &key, const nsACString &data)
|
|||
nsresult
|
||||
SetRestartArgs(int argc, char **argv)
|
||||
{
|
||||
if (!gExceptionHandler)
|
||||
return NS_OK;
|
||||
|
||||
int i;
|
||||
nsCAutoString envVar;
|
||||
char *env;
|
||||
|
|
|
@ -152,7 +152,7 @@ main (int argc, char **argv)
|
|||
NS_InitXPCOM2(nsnull, nsnull, nsnull);
|
||||
|
||||
char* env = new char[13];
|
||||
strcpy(env, "MOZ_AIRBAG=1");
|
||||
strcpy(env, "MOZ_CRASHREPORTER=1");
|
||||
PR_SetEnv(env);
|
||||
|
||||
char* result = all_tests();
|
||||
|
|
|
@ -2305,8 +2305,7 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
|
|||
}
|
||||
|
||||
#ifdef MOZ_AIRBAG
|
||||
//XXX: remove me when this is on by default
|
||||
const char* airbagEnv = PR_GetEnv("MOZ_AIRBAG");
|
||||
const char* airbagEnv = PR_GetEnv("MOZ_CRASHREPORTER");
|
||||
if (airbagEnv && *airbagEnv) {
|
||||
appData.flags |= NS_XRE_ENABLE_CRASH_REPORTER;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче