From c417befae9bfe7c888380e114ee0985e8cf5f8a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Sun, 24 Jun 2012 14:22:38 +0000 Subject: [PATCH] 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] --- v2/engine/execunix.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/v2/engine/execunix.c b/v2/engine/execunix.c index 42777669f..35b6e7759 100644 --- a/v2/engine/execunix.c +++ b/v2/engine/execunix.c @@ -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 ] :