diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 02:29:21 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 02:29:21 +0000 |
commit | f34df9db04b7adaff418b61c35fb1346c1c2fccd (patch) | |
tree | ca9b0e61a1c03f0246b0371423bbbe570193e2f1 /toolkit/crashreporter/client | |
parent | Adding upstream version 115.8.0esr. (diff) | |
download | firefox-esr-f34df9db04b7adaff418b61c35fb1346c1c2fccd.tar.xz firefox-esr-f34df9db04b7adaff418b61c35fb1346c1c2fccd.zip |
Adding upstream version 115.9.0esr.upstream/115.9.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/crashreporter/client')
-rw-r--r-- | toolkit/crashreporter/client/crashreporter.cpp | 33 | ||||
-rw-r--r-- | toolkit/crashreporter/client/moz.build | 1 |
2 files changed, 25 insertions, 9 deletions
diff --git a/toolkit/crashreporter/client/crashreporter.cpp b/toolkit/crashreporter/client/crashreporter.cpp index 4426e6446c..a14ea14fbc 100644 --- a/toolkit/crashreporter/client/crashreporter.cpp +++ b/toolkit/crashreporter/client/crashreporter.cpp @@ -753,16 +753,31 @@ int main(int argc, char** argv) { vector<string> restartArgs; - ostringstream paramName; - int i = 0; - paramName << "MOZ_CRASHREPORTER_RESTART_ARG_" << i++; - const char* param = getenv(paramName.str().c_str()); - while (param && *param) { - restartArgs.push_back(param); - - paramName.str(""); + if (!extraData.isMember("WindowsErrorReporting")) { + // We relaunch the application associated with the client, but only when + // we encountered a crash caught by the exception handler. Crashes handled + // by WER are prevented from directly restarting the application. + string programPath = GetProgramPath(MOZ_APP_NAME); +#ifndef XP_WIN + const char* moz_app_launcher = getenv("MOZ_APP_LAUNCHER"); + if (moz_app_launcher) { + programPath = moz_app_launcher; + } +#endif // XP_WIN + + restartArgs.push_back(programPath); + + ostringstream paramName; + int i = 1; paramName << "MOZ_CRASHREPORTER_RESTART_ARG_" << i++; - param = getenv(paramName.str().c_str()); + const char* param = getenv(paramName.str().c_str()); + while (param && *param) { + restartArgs.push_back(param); + + paramName.str(""); + paramName << "MOZ_CRASHREPORTER_RESTART_ARG_" << i++; + param = getenv(paramName.str().c_str()); + } } // allow override of the server url via environment variable diff --git a/toolkit/crashreporter/client/moz.build b/toolkit/crashreporter/client/moz.build index f678ca1cd6..82e19b8637 100644 --- a/toolkit/crashreporter/client/moz.build +++ b/toolkit/crashreporter/client/moz.build @@ -85,6 +85,7 @@ if CONFIG["OS_ARCH"] == "Linux" or CONFIG["OS_ARCH"] == "SunOS": "Throbber-small.gif", ] +DEFINES["MOZ_APP_NAME"] = '"%s"' % CONFIG["MOZ_APP_NAME"] DEFINES["BIN_SUFFIX"] = '"%s"' % CONFIG["BIN_SUFFIX"] RCINCLUDE = "crashreporter.rc" |