summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2009-11-05 16:53:35 -0500
committerNat Goodspeed <nat@lindenlab.com>2009-11-05 16:53:35 -0500
commit04add8806e49f0e5355666b9b8186d6e0bf78781 (patch)
treeddfbeed53d6fb23e2e7b6723bbb766c4fc2791e2 /indra/newview/llappviewer.cpp
parent6f6d1314e6f1fe12391391172bffa52c9c08e380 (diff)
Support QAModeTermCode var for unattended shutdown on LL_ERRS.
Normally LL_ERRS in a developer build of the viewer pops up an OS message box with the text of the LL_ERRS log message, requiring user intervention to proceed. This isn't good for unattended testing, especially on Parabuild machines. Running the viewer with '--set QAModeTermCode n' for some 0 < n < 256 will, on LL_ERRS, cause the viewer to terminate immediately with _exit(n).
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r--indra/newview/llappviewer.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 873215169e..e95eec4741 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -620,7 +620,19 @@ bool LLAppViewer::init()
if (!initConfiguration())
return false;
-
+
+ // Although initLogging() is the right place to mess with
+ // setFatalFunction(), we can't query gSavedSettings until after
+ // initConfiguration().
+ S32 rc(gSavedSettings.getS32("QAModeTermCode"));
+ if (rc >= 0)
+ {
+ // QAModeTermCode set, terminate with that rc on LL_ERRS. Use _exit()
+ // rather than exit() because normal cleanup depends too much on
+ // successful startup!
+ LLError::setFatalFunction(boost::bind(_exit, rc));
+ }
+
mAlloc.setProfilingEnabled(gSavedSettings.getBOOL("MemProfiling"));
// *NOTE:Mani - LLCurl::initClass is not thread safe.
@@ -1665,7 +1677,7 @@ bool LLAppViewer::initLogging()
LLError::initForApplication(
gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, ""));
LLError::setFatalFunction(errorCallback);
-
+
// Remove the last ".old" log file.
std::string old_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,
"SecondLife.old");