You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2017/01/20 01:15:14 UTC

[05/15] mesos git commit: Windows: Modified `argv[0]` of mesos-containerizer launch command.

Windows: Modified `argv[0]` of mesos-containerizer launch command.

On POSIX, the value of `argv[0]` generally makes no difference when
launching `mesos-containerizer`.  On Windows however, we will not
be able to find the `mesos-containerizer.exe` binary as we launch
subprocesses from `argv[0]` directly (rather than `exec`-ing a
path with some `argv`).

This fills in the value of `argv[0]` to match the binary path.

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


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

Branch: refs/heads/master
Commit: 5d16ec8cc0903dc03b7775975d4446a36e65a00b
Parents: 5fa62b5
Author: Alex Clemmer <cl...@gmail.com>
Authored: Wed Jan 18 13:46:33 2017 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Thu Jan 19 17:04:56 2017 -0800

----------------------------------------------------------------------
 src/slave/containerizer/mesos/containerizer.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/5d16ec8c/src/slave/containerizer/mesos/containerizer.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/containerizer.cpp b/src/slave/containerizer/mesos/containerizer.cpp
index f7d5d92..4f0a773 100644
--- a/src/slave/containerizer/mesos/containerizer.cpp
+++ b/src/slave/containerizer/mesos/containerizer.cpp
@@ -1604,12 +1604,12 @@ Future<bool> MesosContainerizerProcess::_launch(
 
   // Fork the child using launcher.
   vector<string> argv(2);
-  argv[0] = MESOS_CONTAINERIZER;
+  argv[0] = path::join(flags.launcher_dir, MESOS_CONTAINERIZER);
   argv[1] = MesosContainerizerLaunch::NAME;
 
   Try<pid_t> forked = launcher->fork(
       containerId,
-      path::join(flags.launcher_dir, MESOS_CONTAINERIZER),
+      argv[0],
       argv,
       in.isSome() ? in.get() : Subprocess::FD(STDIN_FILENO),
       out.isSome() ? out.get() : Subprocess::FD(STDOUT_FILENO),