You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by al...@apache.org on 2016/08/28 15:04:06 UTC
[06/10] mesos git commit: Moved `process::internal::defaultClone` to
`process::`.
Moved `process::internal::defaultClone` to `process::`.
Review: https://reviews.apache.org/r/51378/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/d2f8bfab
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/d2f8bfab
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/d2f8bfab
Branch: refs/heads/master
Commit: d2f8bfabe48bee5533c30afaecbcf76ef081248f
Parents: 1d00492
Author: haosdent huang <ha...@gmail.com>
Authored: Fri Aug 26 16:34:01 2016 +0200
Committer: Alexander Rukletsov <al...@apache.org>
Committed: Sun Aug 28 16:42:57 2016 +0200
----------------------------------------------------------------------
.../include/process/posix/subprocess.hpp | 33 ++++++++++----------
1 file changed, 17 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/d2f8bfab/3rdparty/libprocess/include/process/posix/subprocess.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/posix/subprocess.hpp b/3rdparty/libprocess/include/process/posix/subprocess.hpp
index a871fe4..57f71d1 100644
--- a/3rdparty/libprocess/include/process/posix/subprocess.hpp
+++ b/3rdparty/libprocess/include/process/posix/subprocess.hpp
@@ -51,6 +51,23 @@ namespace process {
using InputFileDescriptors = Subprocess::IO::InputFileDescriptors;
using OutputFileDescriptors = Subprocess::IO::OutputFileDescriptors;
+
+inline pid_t defaultClone(const lambda::function<int()>& func)
+{
+ pid_t pid = ::fork();
+ if (pid == -1) {
+ return -1;
+ } else if (pid == 0) {
+ // Child.
+ ::exit(func());
+ UNREACHABLE();
+ } else {
+ // Parent.
+ return pid;
+ }
+}
+
+
namespace internal {
// This function will invoke `os::close` on all specified file
@@ -100,22 +117,6 @@ inline Try<Nothing> cloexec(
}
-inline pid_t defaultClone(const lambda::function<int()>& func)
-{
- pid_t pid = ::fork();
- if (pid == -1) {
- return -1;
- } else if (pid == 0) {
- // Child.
- ::exit(func());
- UNREACHABLE();
- } else {
- // Parent.
- return pid;
- }
-}
-
-
inline void signalHandler(int signal)
{
// Send SIGKILL to every process in the process group of the