From 0c16d0b5140391351941d809f6997e85186e1ff5 Mon Sep 17 00:00:00 2001 From: Myun2 Date: Sat, 6 Nov 2010 19:51:08 +0900 Subject: [PATCH] =?utf8?q?[linux]=20fork=E5=8B=95=E3=81=8F=E3=82=88?= =?utf8?q?=E3=81=86=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- roast/include/roast/unix/fork.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/roast/include/roast/unix/fork.hpp b/roast/include/roast/unix/fork.hpp index e8f7e1b3..7b567e40 100755 --- a/roast/include/roast/unix/fork.hpp +++ b/roast/include/roast/unix/fork.hpp @@ -11,14 +11,15 @@ namespace roast { /////////////////////////////////////////////////////// - template - int fork_func(_ParentFunctor parent_fnctr, _ChildFunctor child_fnctr) + template + int fork_func(_ChildFunctor child_fnctr, _ParentFunctor parent_fnctr) { int pid = ::fork(); if ( pid == 0 ) child_fnctr(); else parent_fnctr(pid); + return pid; } class forker @@ -26,8 +27,8 @@ namespace roast protected: pid_t m_pid; public: - template - forker(_ParentFunctor parent_fnctr, _ChildFunctor child_fnctr) + template + forker(_ChildFunctor child_fnctr, _ParentFunctor parent_fnctr) { fork_func(parent_fnctr, child_fnctr); } -- 2.11.0