Bug 1380110 Fix --disable-sandbox by adding #if guards r?handyman
MozReview-Commit-ID: ETjN2KTUi4l
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -4464,20 +4464,22 @@ XREMain::XRE_mainRun()
// Ugly details in http://bugzil.la/1175039#c27
char appFile[MAX_PATH];
if (GetEnvironmentVariableA("XUL_APP_FILE", appFile, sizeof(appFile))) {
SmprintfPointer saved = mozilla::Smprintf("XUL_APP_FILE=%s", appFile);
// We intentionally leak the string here since it is required by PR_SetEnv.
PR_SetEnv(saved.release());
}
+#if defined(MOZ_SANDBOX)
// Call SandboxBroker to cache directories needed for policy rules, this must
// be called after mDirProvider.DoStartup as it needs the profile dir.
SandboxBroker::CacheRulesDirectories();
#endif
+#endif
SaveStateForAppInitiatedRestart();
// clear out any environment variables which may have been set
// during the relaunch process now that we know we won't be relaunching.
SaveToEnv("XRE_PROFILE_PATH=");
SaveToEnv("XRE_PROFILE_LOCAL_PATH=");
SaveToEnv("XRE_PROFILE_NAME=");