Removed unnecessary use of os::ExecEnv. Review: https://reviews.apache.org/r/35562
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/4510560d Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/4510560d Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/4510560d Branch: refs/heads/master Commit: 4510560da6255eba00014096c4c0defbc2d31f0b Parents: 14b49f3 Author: Benjamin Hindman <[email protected]> Authored: Sun Jun 14 11:21:49 2015 -0700 Committer: Benjamin Hindman <[email protected]> Committed: Wed Jun 24 17:27:24 2015 -0700 ---------------------------------------------------------------------- src/slave/containerizer/mesos/launch.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/4510560d/src/slave/containerizer/mesos/launch.cpp ---------------------------------------------------------------------- diff --git a/src/slave/containerizer/mesos/launch.cpp b/src/slave/containerizer/mesos/launch.cpp index 2f2d60e..51bc068 100644 --- a/src/slave/containerizer/mesos/launch.cpp +++ b/src/slave/containerizer/mesos/launch.cpp @@ -20,22 +20,18 @@ #include <unistd.h> #include <iostream> -#include <map> #include <stout/foreach.hpp> #include <stout/os.hpp> #include <stout/protobuf.hpp> #include <stout/unreachable.hpp> -#include <stout/os/execenv.hpp> - #include "mesos/mesos.hpp" #include "slave/containerizer/mesos/launch.hpp" using std::cerr; using std::endl; -using std::map; using std::string; namespace mesos { @@ -217,20 +213,11 @@ int MesosContainerizerLaunch::execute() } } - // Relay the environment variables. // TODO(jieyu): Consider using a clean environment. - map<string, string> env; - os::ExecEnv envp(env); if (command.get().shell()) { // Execute the command using shell. - execle( - "/bin/sh", - "sh", - "-c", - command.get().value().c_str(), - (char*) NULL, - envp()); + execl("/bin/sh", "sh", "-c", command.get().value().c_str(), (char*) NULL); } else { // Use os::execvpe to launch the command. char** argv = new char*[command.get().arguments().size() + 1]; @@ -239,7 +226,7 @@ int MesosContainerizerLaunch::execute() } argv[command.get().arguments().size()] = NULL; - os::execvpe(command.get().value().c_str(), argv, envp()); + execvp(command.get().value().c_str(), argv); } // If we get here, the execle call failed.
