mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andsc...@apache.org
Subject [05/13] mesos git commit: Windows: Fixed environment priorities in `shell.hpp`.
Date Thu, 30 Nov 2017 03:28:24 GMT
Windows: Fixed environment priorities in `shell.hpp`.

Legacy code had caused the system environment to explicitly override the
supplied environment, but this is incorrect. The system environment
should be the default, with any supplied environment variables
overriding those.

Review: https://reviews.apache.org/r/63815


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/76ce648b
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/76ce648b
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/76ce648b

Branch: refs/heads/master
Commit: 76ce648b56e18f8c28dc163b7e0d10f5b16ee6f0
Parents: 5832226
Author: Andrew Schwartzmeyer <andrew@schwartzmeyer.com>
Authored: Fri Nov 3 12:31:47 2017 -0700
Committer: Andrew Schwartzmeyer <andrew@schwartzmeyer.com>
Committed: Wed Nov 29 19:24:11 2017 -0800

----------------------------------------------------------------------
 3rdparty/stout/include/stout/os/windows/shell.hpp | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/76ce648b/3rdparty/stout/include/stout/os/windows/shell.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/os/windows/shell.hpp b/3rdparty/stout/include/stout/os/windows/shell.hpp
index 5c71183..542039c 100644
--- a/3rdparty/stout/include/stout/os/windows/shell.hpp
+++ b/3rdparty/stout/include/stout/os/windows/shell.hpp
@@ -116,21 +116,20 @@ inline Option<std::wstring> create_process_env(
 
   std::map<std::wstring, std::wstring> combined_env;
 
-  // Populate the combined environment first with the given environment
-  // converted to UTF-16 for Windows.
-  foreachpair (const std::string& key,
-               const std::string& value,
-               env.get()) {
-    combined_env[wide_stringify(key)] = wide_stringify(value);
-  }
-
-  // Add the system environment variables, overwriting the previous.
+  // Populate the combined environment first with the system environment.
   foreachpair (const std::wstring& key,
                const std::wstring& value,
                system_env.get()) {
     combined_env[key] = value;
   }
 
+  // Now override with the supplied environment.
+  foreachpair (const std::string& key,
+               const std::string& value,
+               env.get()) {
+    combined_env[wide_stringify(key)] = wide_stringify(value);
+  }
+
   std::wstring env_string;
   foreachpair (const std::wstring& key,
                const std::wstring& value,


Mime
View raw message