summaryrefslogtreecommitdiff
path: root/indra/llcommon/llprocess.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-07-21 21:32:27 +0800
committerErik Kundiman <erik@megapahit.org>2024-07-21 21:32:27 +0800
commit790e708ffc1cb138a484249b3ac7f240be21dd98 (patch)
tree17ad9b813d718d47be2bbd8f8393677c5070f503 /indra/llcommon/llprocess.cpp
parentfe09a456ebc4c5db3e3dc10f26a3c64ca88428f7 (diff)
parent8f66fcb7e32ce074fda9816efec37b45659c45e3 (diff)
Merge branch 'main' into webrtc-voice
Diffstat (limited to 'indra/llcommon/llprocess.cpp')
-rw-r--r--indra/llcommon/llprocess.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/indra/llcommon/llprocess.cpp b/indra/llcommon/llprocess.cpp
index 2208b33b94..cf19e3aae9 100644
--- a/indra/llcommon/llprocess.cpp
+++ b/indra/llcommon/llprocess.cpp
@@ -691,10 +691,22 @@ LLProcess::LLProcess(const LLSDOrParams& params):
// terminate with a null pointer
argv.push_back(NULL);
+ // create an env vector for the child process
+ std::vector<const char*> envv;
+
+ // Add environment value assignments. See above remarks about c_str().
+ for (const std::string& env : params.envs)
+ {
+ envv.push_back(env.c_str());
+ }
+
+ // terminate with a null pointer
+ envv.push_back(NULL);
+
// Launch! The NULL would be the environment block, if we were passing
// one. Hand-expand chkapr() macro so we can fill in the actual command
// string instead of the variable names.
- if (ll_apr_warn_status(apr_proc_create(&mProcess, argv[0], &argv[0], NULL, procattr,
+ if (ll_apr_warn_status(apr_proc_create(&mProcess, argv[0], &argv[0], &envv[0], procattr,
mPool)))
{
LLTHROW(LLProcessError(STRINGIZE(params << " failed")));