summaryrefslogtreecommitdiff
path: root/indra/viewer_components/updater
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2012-01-20 18:10:40 -0500
committerNat Goodspeed <nat@lindenlab.com>2012-01-20 18:10:40 -0500
commitf0dbb878337082d3f581874c12e6df2f4659a464 (patch)
treed147656500ef78b10b2fe6176b03f617a6862429 /indra/viewer_components/updater
parent083a9e0927144a9e2f052bc8573da8a26259a257 (diff)
Per Richard, replace LLProcessLauncher with LLProcess.
LLProcessLauncher had the somewhat fuzzy mandate of (1) accumulating parameters with which to launch a child process and (2) sometimes tracking the lifespan of the ensuing child process. But a valid LLProcessLauncher object might or might not have ever been associated with an actual child process. LLProcess specifically tracks a child process. In effect, it's a fairly thin wrapper around a process HANDLE (on Windows) or pid_t (elsewhere), with lifespan management thrown in. A static LLProcess::create() method launches a new child; create() accepts an LLSD bundle with child parameters. So building up a parameter bundle is deferred to LLSD rather than conflated with the process management object. Reconcile all known LLProcessLauncher consumers in the viewer code base, notably the class unit tests.
Diffstat (limited to 'indra/viewer_components/updater')
-rw-r--r--indra/viewer_components/updater/llupdateinstaller.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/indra/viewer_components/updater/llupdateinstaller.cpp b/indra/viewer_components/updater/llupdateinstaller.cpp
index 84f23b3acc..e99fd0af7e 100644
--- a/indra/viewer_components/updater/llupdateinstaller.cpp
+++ b/indra/viewer_components/updater/llupdateinstaller.cpp
@@ -26,10 +26,10 @@
#include "linden_common.h"
#include <apr_file_io.h>
#include "llapr.h"
-#include "llprocesslauncher.h"
+#include "llprocess.h"
#include "llupdateinstaller.h"
#include "lldir.h"
-
+#include "llsd.h"
#if defined(LL_WINDOWS)
#pragma warning(disable: 4702) // disable 'unreachable code' so we can use lexical_cast (really!).
@@ -78,15 +78,13 @@ int ll_install_update(std::string const & script,
llinfos << "UpdateInstaller: installing " << updatePath << " using " <<
actualScriptPath << LL_ENDL;
- LLProcessLauncher launcher;
- launcher.setExecutable(actualScriptPath);
- launcher.addArgument(updatePath);
- launcher.addArgument(ll_install_failed_marker_path());
- launcher.addArgument(boost::lexical_cast<std::string>(required));
- int result = launcher.launch();
- launcher.orphan();
-
- return result;
+ LLSD params;
+ params["executable"] = actualScriptPath;
+ params["args"].append(updatePath);
+ params["args"].append(ll_install_failed_marker_path());
+ params["args"].append(boost::lexical_cast<std::string>(required));
+ params["autokill"] = false;
+ return LLProcess::create(params)? 0 : -1;
}