diff options
author | Erik Kundiman <erik@megapahit.org> | 2024-07-21 21:21:12 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2024-07-21 21:21:12 +0800 |
commit | 8f66fcb7e32ce074fda9816efec37b45659c45e3 (patch) | |
tree | a6113ccc6585afdc87522de4d70072b0f93b0abc /indra/llcommon/llprocess.cpp | |
parent | 9a4d15f647bc90cc6b760cbad4bc4dab877f217b (diff) |
Wine-based Vivox-based voice support for FreeBSD
https://megapahit.com/show_bug.cgi?id=57
For SLVoice to run, there is a couple of environment variables that need
to be set, and users need to run
`/usr/local/share/wine/pkg32.sh install wine mesa-dri`
to install the necessary files first.
All this time the env parameter on apr_proc_create was never used, and
this is just the place for passing those environment settings, hence the
LLProcess::Param attribute addition.
Diffstat (limited to 'indra/llcommon/llprocess.cpp')
-rw-r--r-- | indra/llcommon/llprocess.cpp | 14 |
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"))); |