You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by an...@apache.org on 2017/11/30 03:28:22 UTC

[03/13] mesos git commit: Windows: Fixed `os::host_default_path()`.

Windows: Fixed `os::host_default_path()`.

This adds the necessary and expected default paths to the default `PATH`
value represented by this function. Especially needed was the
`WindowsPowerShell` folder so that tasks using PowerShell can run.

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


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

Branch: refs/heads/master
Commit: 583222650a078a9233919e2645080aeaa6507c74
Parents: 3b130a4
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Fri Nov 3 12:27:02 2017 -0700
Committer: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Committed: Wed Nov 29 19:24:11 2017 -0800

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


http://git-wip-us.apache.org/repos/asf/mesos/blob/58322265/3rdparty/stout/include/stout/windows/os.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/windows/os.hpp b/3rdparty/stout/include/stout/windows/os.hpp
index a24bad9..09469e9 100644
--- a/3rdparty/stout/include/stout/windows/os.hpp
+++ b/3rdparty/stout/include/stout/windows/os.hpp
@@ -801,13 +801,17 @@ inline std::string host_default_path()
 {
   // NOTE: On Windows, this code must run on the host where we are
   // expecting to `exec` the task, because the value of
-  // `%SYSTEMROOT%` is not identical on all platforms.
-  const Option<std::string> system_root_env = os::getenv("SYSTEMROOT");
+  // `%SystemRoot%` is not identical on all platforms.
+  const Option<std::string> system_root_env = os::getenv("SystemRoot");
   const std::string system_root = system_root_env.isSome()
     ? system_root_env.get()
-    : "C:\\WINDOWS";
+    : path::join("C:", "Windows");
 
-  return strings::join(";", system_root, path::join(system_root, "system32"));
+  return strings::join(";",
+      path::join(system_root, "System32"),
+      system_root,
+      path::join(system_root, "System32", "Wbem"),
+      path::join(system_root, "System32", "WindowsPowerShell", "v1.0"));
 }
 
 } // namespace os {