mirror of
https://github.com/boostorg/build.git
synced 2026-02-14 00:32:11 +00:00
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. [SVN r58785]
This commit is contained in:
@@ -226,13 +226,13 @@ void exec_cmd
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user