2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-16 13:22:11 +00:00

Boost Jam code cleanup - minor stylistic change - pipes used to communicate with child processes no longer have their parent side descriptors inherited by the child process instead of being explicitly closed in the child process.

[SVN r79061]
This commit is contained in:
Jurko Gospodnetić
2012-06-24 14:22:38 +00:00
parent 6276126884
commit c417befae9

View File

@@ -198,6 +198,10 @@ void exec_cmd
if ( tps == 0 ) tps = sysconf( _SC_CLK_TCK );
}
/* Child does not need the read pipe ends used by the parent. */
fcntl( out[ EXECCMD_PIPE_READ ], F_SETFD, FD_CLOEXEC );
fcntl( err[ EXECCMD_PIPE_READ ], F_SETFD, FD_CLOEXEC );
if ( ( cmdtab[ slot ].pid = vfork() ) == -1 )
{
perror( "vfork" );
@@ -211,9 +215,6 @@ void exec_cmd
/*****************/
int const pid = getpid();
close( out[ EXECCMD_PIPE_READ ] );
close( err[ EXECCMD_PIPE_READ ] );
/* Redirect stdout and stderr to pipes inherited from the parent. */
dup2( out[ EXECCMD_PIPE_WRITE ], STDOUT_FILENO );
dup2( globs.pipe_action ? err[ EXECCMD_PIPE_WRITE ] :