Used execlp instead of execl to exec processes in stout.

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


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

Branch: refs/heads/master
Commit: e70493a8acd3c6848bb9dbe7f7a72e694fe6cf07
Parents: ccc4c60
Author: Jie Yu <[email protected]>
Authored: Mon Aug 17 12:47:31 2015 -0700
Committer: Jie Yu <[email protected]>
Committed: Mon Aug 17 14:27:30 2015 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/fork.hpp | 2 +-
 3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/e70493a8/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/fork.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/fork.hpp 
b/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/fork.hpp
index 5592e10..d43433a 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/fork.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/fork.hpp
@@ -361,7 +361,7 @@ private:
     if (exec.isSome()) {
       // Execute the command (via '/bin/sh -c command').
       const char* command = exec.get().command.c_str();
-      execl("/bin/sh", "sh", "-c", command, (char*) NULL);
+      execlp("sh", "sh", "-c", command, (char*) NULL);
       EXIT(1) << "Failed to execute '" << command << "': " << strerror(errno);
     } else if (wait.isSome()) {
       foreach (pid_t pid, pids) {

http://git-wip-us.apache.org/repos/asf/mesos/blob/e70493a8/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp 
b/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp
index c848268..5d2f39d 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp
@@ -281,7 +281,7 @@ inline int system(const std::string& command)
     return -1;
   } else if (pid == 0) {
     // In child process.
-    ::execl("/bin/sh", "sh", "-c", command.c_str(), (char*) NULL);
+    ::execlp("sh", "sh", "-c", command.c_str(), (char*) NULL);
     ::exit(127);
   } else {
     // In parent process.

Reply via email to