Pass the environment as a const reference so nobody else is tempted to modify it
This commit is contained in:
@@ -547,7 +547,7 @@ namespace platf {
|
|||||||
display_names(mem_type_e hwdevice_type);
|
display_names(mem_type_e hwdevice_type);
|
||||||
|
|
||||||
boost::process::child
|
boost::process::child
|
||||||
run_command(bool elevated, bool interactive, const std::string &cmd, boost::filesystem::path &working_dir, boost::process::environment &env, FILE *file, std::error_code &ec, boost::process::group *group);
|
run_command(bool elevated, bool interactive, const std::string &cmd, boost::filesystem::path &working_dir, const boost::process::environment &env, FILE *file, std::error_code &ec, boost::process::group *group);
|
||||||
|
|
||||||
enum class thread_priority_e : int {
|
enum class thread_priority_e : int {
|
||||||
low,
|
low,
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ namespace platf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bp::child
|
bp::child
|
||||||
run_command(bool elevated, bool interactive, const std::string &cmd, boost::filesystem::path &working_dir, bp::environment &env, FILE *file, std::error_code &ec, bp::group *group) {
|
run_command(bool elevated, bool interactive, const std::string &cmd, boost::filesystem::path &working_dir, const bp::environment &env, FILE *file, std::error_code &ec, bp::group *group) {
|
||||||
if (!group) {
|
if (!group) {
|
||||||
if (!file) {
|
if (!file) {
|
||||||
return bp::child(cmd, env, bp::start_dir(working_dir), bp::std_out > bp::null, bp::std_err > bp::null, ec);
|
return bp::child(cmd, env, bp::start_dir(working_dir), bp::std_out > bp::null, bp::std_err > bp::null, ec);
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ namespace platf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bp::child
|
bp::child
|
||||||
run_command(bool elevated, bool interactive, const std::string &cmd, boost::filesystem::path &working_dir, bp::environment &env, FILE *file, std::error_code &ec, bp::group *group) {
|
run_command(bool elevated, bool interactive, const std::string &cmd, boost::filesystem::path &working_dir, const bp::environment &env, FILE *file, std::error_code &ec, bp::group *group) {
|
||||||
if (!group) {
|
if (!group) {
|
||||||
if (!file) {
|
if (!file) {
|
||||||
return bp::child(cmd, env, bp::start_dir(working_dir), bp::std_out > bp::null, bp::std_err > bp::null, ec);
|
return bp::child(cmd, env, bp::start_dir(working_dir), bp::std_out > bp::null, bp::std_err > bp::null, ec);
|
||||||
|
|||||||
@@ -565,7 +565,7 @@ namespace platf {
|
|||||||
* @return A `bp::child` object representing the new process, or an empty `bp::child` object if the launch fails.
|
* @return A `bp::child` object representing the new process, or an empty `bp::child` object if the launch fails.
|
||||||
*/
|
*/
|
||||||
bp::child
|
bp::child
|
||||||
run_command(bool elevated, bool interactive, const std::string &cmd, boost::filesystem::path &working_dir, bp::environment &env, FILE *file, std::error_code &ec, bp::group *group) {
|
run_command(bool elevated, bool interactive, const std::string &cmd, boost::filesystem::path &working_dir, const bp::environment &env, FILE *file, std::error_code &ec, bp::group *group) {
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
// Convert cmd, env, and working_dir to the appropriate character sets for Win32 APIs
|
// Convert cmd, env, and working_dir to the appropriate character sets for Win32 APIs
|
||||||
std::wstring wcmd = converter.from_bytes(cmd);
|
std::wstring wcmd = converter.from_bytes(cmd);
|
||||||
|
|||||||
Reference in New Issue
Block a user