$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r64281 - in sandbox/SOC/2010/process/boost/process: . detail
From: fotanus_at_[hidden]
Date: 2010-07-22 21:36:20
Author: fotanus
Date: 2010-07-22 21:36:16 EDT (Thu, 22 Jul 2010)
New Revision: 64281
URL: http://svn.boost.org/trac/boost/changeset/64281
Log:
Small fixes to compile on linux
Text files modified: 
   sandbox/SOC/2010/process/boost/process/detail/basic_status_service.hpp |     7 ++++---                                 
   sandbox/SOC/2010/process/boost/process/detail/posix_helpers.hpp        |    13 +++++++++++++                           
   sandbox/SOC/2010/process/boost/process/detail/status_impl.hpp          |     2 +-                                      
   sandbox/SOC/2010/process/boost/process/stream_behavior.hpp             |     4 ++--                                    
   4 files changed, 20 insertions(+), 6 deletions(-)
Modified: sandbox/SOC/2010/process/boost/process/detail/basic_status_service.hpp
==============================================================================
--- sandbox/SOC/2010/process/boost/process/detail/basic_status_service.hpp	(original)
+++ sandbox/SOC/2010/process/boost/process/detail/basic_status_service.hpp	2010-07-22 21:36:16 EDT (Thu, 22 Jul 2010)
@@ -94,7 +94,7 @@
     void destroy(implementation_type &impl)
     {
         boost::unique_lock<boost::mutex> lock(work_thread_mutex_);
-        std::vector<implementation_type>::iterator it = std::find(impls_.begin(), impls_.end(), impl);
+        typename ::std::vector<implementation_type>::iterator it = std::find(impls_.begin(), impls_.end(), impl);
         if (it != impls_.end())
             impls_.erase(it);
         impl.reset();
@@ -143,7 +143,7 @@
         {
 #if defined(BOOST_POSIX_API)
             int status;
-            pid_t pid = wait(&status);
+            pid_t pid = ::wait(&status);
             if (pid == -1)
             {
                 if (errno != EINTR)
@@ -157,7 +157,7 @@
             else
             {
                 boost::unique_lock<boost::mutex> lock(work_thread_mutex_);
-                for (std::vector<implementation_type>::iterator it = impls_.begin(); it != impls_.end(); ++it)
+                for (typename std::vector<implementation_type>::iterator it = impls_.begin(); it != impls_.end(); ++it)
                     (*it)->complete(pid, status);
                 if (--pids_ == 0)
                     work_.reset();
@@ -198,6 +198,7 @@
 #if defined(BOOST_POSIX_API)
         // By creating a child process which immediately exits we interrupt wait().
         interrupt_pid_ = create_child("/usr/sh").get_id();
+
 #elif defined(BOOST_WINDOWS_API)
         // By signaling the event in the first slot WaitForMultipleObjects() will return.
         // The work thread won't do anything except checking if it should continue to run.
Modified: sandbox/SOC/2010/process/boost/process/detail/posix_helpers.hpp
==============================================================================
--- sandbox/SOC/2010/process/boost/process/detail/posix_helpers.hpp	(original)
+++ sandbox/SOC/2010/process/boost/process/detail/posix_helpers.hpp	2010-07-22 21:36:16 EDT (Thu, 22 Jul 2010)
@@ -100,4 +100,17 @@
 }
 }
 
+/*
+ * posix_remap helper function
+ *
+ * Given a native and other handle, it changes the native for the other.
+ * It simply uses dup2 POSIX function and trow an error when needed.
+ *
+ */
+
+void posix_remap(int native_handle, int new_handle)
+{
+    if (::dup2(new_handle, native_handle) == -1)
+        BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("dup2() failed"); 
+}
 #endif
Modified: sandbox/SOC/2010/process/boost/process/detail/status_impl.hpp
==============================================================================
--- sandbox/SOC/2010/process/boost/process/detail/status_impl.hpp	(original)
+++ sandbox/SOC/2010/process/boost/process/detail/status_impl.hpp	2010-07-22 21:36:16 EDT (Thu, 22 Jul 2010)
@@ -75,7 +75,7 @@
 class status_impl
 {
 public:
-    int wait(pid_type pid, boost::system::error_code ec)
+    int wait(pid_type pid, boost::system::system_error ec)
     {
 #if defined(BOOST_POSIX_API)
         pid_t p;
Modified: sandbox/SOC/2010/process/boost/process/stream_behavior.hpp
==============================================================================
--- sandbox/SOC/2010/process/boost/process/stream_behavior.hpp	(original)
+++ sandbox/SOC/2010/process/boost/process/stream_behavior.hpp	2010-07-22 21:36:16 EDT (Thu, 22 Jul 2010)
@@ -58,7 +58,7 @@
      *
      * On POSIX systems it is defined as int, on Windows systems as HANDLE.
      */
-#if defined(BOOST_POSIX_API)
+#if defined(BOOST_PROCESS_DOXYGEN)
     typedef NativeStreamType stream_end_type;
 #elif defined(BOOST_POSIX_API)
     typedef int stream_end_type;
@@ -156,7 +156,7 @@
     {
         stream_end_type ends[2];
 #if defined(BOOST_POSIX_API)
-        if (pipe(ends) == -1)
+        if (::pipe(ends) == -1)
             BOOST_PROCESS_THROW_LAST_SYSTEM_ERROR("pipe(2) failed");
 #elif defined(BOOST_WINDOWS_API)
         SECURITY_ATTRIBUTES sa;