You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2014/08/14 05:52:57 UTC
[3/4] git commit: Updated mesos to use os::execvpe.
Updated mesos to use os::execvpe.
Review: https://reviews.apache.org/r/24682
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/8efdb510
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/8efdb510
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/8efdb510
Branch: refs/heads/master
Commit: 8efdb5107391876083383730610e94311d1f3b80
Parents: 49e94f3
Author: Jie Yu <yu...@gmail.com>
Authored: Wed Aug 13 16:28:38 2014 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Wed Aug 13 20:52:35 2014 -0700
----------------------------------------------------------------------
src/health-check/main.cpp | 2 +-
src/launcher/executor.cpp | 2 +-
src/slave/containerizer/mesos/launch.cpp | 4 ++--
src/tests/health_check_tests.cpp | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/8efdb510/src/health-check/main.cpp
----------------------------------------------------------------------
diff --git a/src/health-check/main.cpp b/src/health-check/main.cpp
index 730a7a2..a4ce742 100644
--- a/src/health-check/main.cpp
+++ b/src/health-check/main.cpp
@@ -176,7 +176,7 @@ private:
Subprocess::FD(STDERR_FILENO),
environment);
} else {
- // Use the execve variant.
+ // Use the exec variant.
if (!command.has_value()) {
promise.fail("Executable path is not specified");
return;
http://git-wip-us.apache.org/repos/asf/mesos/blob/8efdb510/src/launcher/executor.cpp
----------------------------------------------------------------------
diff --git a/src/launcher/executor.cpp b/src/launcher/executor.cpp
index 9b767a5..1aa2c99 100644
--- a/src/launcher/executor.cpp
+++ b/src/launcher/executor.cpp
@@ -452,7 +452,7 @@ private:
if (task.has_health_check()) {
JSON::Object json = JSON::Protobuf(task.health_check());
- // Launch the subprocess using 'execve' style so that quotes can
+ // Launch the subprocess using 'exec' style so that quotes can
// be properly handled.
vector<string> argv(4);
argv[0] = "mesos-health-check";
http://git-wip-us.apache.org/repos/asf/mesos/blob/8efdb510/src/slave/containerizer/mesos/launch.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/launch.cpp b/src/slave/containerizer/mesos/launch.cpp
index 35b57b3..9819381 100644
--- a/src/slave/containerizer/mesos/launch.cpp
+++ b/src/slave/containerizer/mesos/launch.cpp
@@ -232,14 +232,14 @@ int MesosContainerizerLaunch::execute()
(char*) NULL,
envp());
} else {
- // Use execve to launch the command.
+ // Use os::execvpe to launch the command.
char** argv = new char*[command.get().arguments().size() + 1];
for (int i = 0; i < command.get().arguments().size(); i++) {
argv[i] = strdup(command.get().arguments(i).c_str());
}
argv[command.get().arguments().size()] = NULL;
- execve(command.get().value().c_str(), argv, envp());
+ os::execvpe(command.get().value().c_str(), argv, envp());
}
// If we get here, the execle call failed.
http://git-wip-us.apache.org/repos/asf/mesos/blob/8efdb510/src/tests/health_check_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/health_check_tests.cpp b/src/tests/health_check_tests.cpp
index b6d7fa8..aed1101 100644
--- a/src/tests/health_check_tests.cpp
+++ b/src/tests/health_check_tests.cpp
@@ -230,7 +230,7 @@ TEST_F(HealthCheckTest, HealthyTaskNonShell)
CommandInfo command;
command.set_shell(false);
- command.set_value("/bin/true");
+ command.set_value("true");
command.add_arguments("true");
vector<TaskInfo> tasks =