Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58785 - trunk/tools/jam/src
From: kbelco_at_[hidden]
Date: 2010-01-07 00:57:34


Author: noel_belcourt
Date: 2010-01-07 00:57:33 EST (Thu, 07 Jan 2010)
New Revision: 58785
URL: http://svn.boost.org/trac/boost/changeset/58785

Log:
This patch ensures we close both file descriptors following the dup2 calls.
This is mostly for completeness but also because I've occasionally noticed
output isn't flushed from a terminated process (when it is killed for exceeding
the time limit). I'm sure this won't break anything and am slightly hopeful
that it might ensure output is flushed before the terminating process is killed.

Text files modified:
   trunk/tools/jam/src/execunix.c | 6 +++---
   1 files changed, 3 insertions(+), 3 deletions(-)

Modified: trunk/tools/jam/src/execunix.c
==============================================================================
--- trunk/tools/jam/src/execunix.c (original)
+++ trunk/tools/jam/src/execunix.c 2010-01-07 00:57:33 EST (Thu, 07 Jan 2010)
@@ -226,13 +226,13 @@
         dup2( out[1], STDOUT_FILENO );
 
         if ( globs.pipe_action == 0 )
- {
             dup2( out[1], STDERR_FILENO );
- close( err[1] );
- }
         else
             dup2( err[1], STDERR_FILENO );
 
+ close( out[1] );
+ close( err[1] );
+
         /* Make this process a process group leader so that when we kill it, all
          * child processes of this process are terminated as well. We use
          * killpg(pid, SIGKILL) to kill the process group leader and all its


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