Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64311 - sandbox/SOC/2010/process/boost/process
From: boris_at_[hidden]
Date: 2010-07-23 23:34:56


Author: bschaeling
Date: 2010-07-23 23:34:39 EDT (Fri, 23 Jul 2010)
New Revision: 64311
URL: http://svn.boost.org/trac/boost/changeset/64311

Log:
Added code to close child ends on Windows in created_child()
Text files modified:
   sandbox/SOC/2010/process/boost/process/context.hpp | 2 +-
   sandbox/SOC/2010/process/boost/process/operations.hpp | 7 +++++++
   2 files changed, 8 insertions(+), 1 deletions(-)

Modified: sandbox/SOC/2010/process/boost/process/context.hpp
==============================================================================
--- sandbox/SOC/2010/process/boost/process/context.hpp (original)
+++ sandbox/SOC/2010/process/boost/process/context.hpp 2010-07-23 23:34:39 EDT (Fri, 23 Jul 2010)
@@ -85,7 +85,7 @@
      * The default behavior of standard streams is to inherit them. The current
      * work directory is also the work directory of the child process. The child
      * process also inherits all environment variables.
- */
+ */
     context()
 #if defined(BOOST_POSIX_API)
         : stdin_behavior(behavior::inherit::def(STDIN_FILENO)),

Modified: sandbox/SOC/2010/process/boost/process/operations.hpp
==============================================================================
--- sandbox/SOC/2010/process/boost/process/operations.hpp (original)
+++ sandbox/SOC/2010/process/boost/process/operations.hpp 2010-07-23 23:34:39 EDT (Fri, 23 Jul 2010)
@@ -318,6 +318,13 @@
     // leak the process handle in pi.hProcess.
     CloseHandle(pi.hThread);
 
+ if (ctx.stdin_behavior->get_child_end() != INVALID_HANDLE_VALUE)
+ CloseHandle(ctx.stdin_behavior->get_child_end());
+ if (ctx.stdout_behavior->get_child_end() != INVALID_HANDLE_VALUE)
+ CloseHandle(ctx.stdout_behavior->get_child_end());
+ if (ctx.stderr_behavior->get_child_end() != INVALID_HANDLE_VALUE)
+ CloseHandle(ctx.stderr_behavior->get_child_end());
+
     return child(pi.hProcess,
         detail::file_handle(ctx.stdin_behavior->get_parent_end()),
         detail::file_handle(ctx.stdout_behavior->get_parent_end()),


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk