2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-17 01:32:12 +00:00

Fix buffer output so newline is actully written to

cmd buffer.  Also move some closure diagnostics to
avoid interleaved output (no functional change, just
better encapsulation).



[SVN r79341]
This commit is contained in:
K. Noel Belcourt
2012-07-08 02:36:24 +00:00
parent 8e05bdc38a
commit 3c3e5d01d3
2 changed files with 23 additions and 22 deletions

View File

@@ -339,8 +339,9 @@ static int read_descriptor( int i, int s )
* contains the command status at beginning of it own line instead of
* appended to end of the previous output.
*/
if ( globs.max_buf && cmdtab[ i ].buf_size[ s ] == globs.max_buf )
if ( globs.max_buf && globs.max_buf <= cmdtab[i].buf_size[s] ) {
cmdtab[ i ].buffer[ s ][ cmdtab[ i ].buf_size[ s ] - 2 ] = '\n';
}
return feof( cmdtab[ i ].stream[ s ] );
}

View File

@@ -822,7 +822,7 @@ static void call_action_rule
static void make_closure
(
void * const closure,
int const status,
int status,
timing_info const * const time,
char const * const cmd_stdout,
char const * const cmd_stderr,
@@ -830,7 +830,7 @@ static void make_closure
)
{
TARGET * const t = (TARGET *)closure;
CMD const * const cmd = (CMD *)t->cmds;
CMD * cmd = (CMD *)t->cmds;
char const * rule_name = 0;
char const * target_name = 0;
@@ -858,25 +858,6 @@ static void make_closure
call_action_rule( t, status, time, cmd->buf->value, cmd_stdout );
}
push_state( &state_stack, t, NULL, T_STATE_MAKE1D )->status = status;
}
/*
* make1d() - handle command execution completion and call back make1c().
*
* exec_cmd() has completed and now all we need to do is fiddle with the status
* and call back to make1c() so it can run the next command scheduled for
* building this target or close up the target's build process in case there are
* no more commands scheduled for it. On interrupts, we bail heavily.
*/
static void make1d( state * pState )
{
TARGET * t = pState->t;
CMD * cmd = (CMD *)t->cmds;
int status = pState->status;
if ( t->flags & T_FLAG_FAIL_EXPECTED && !globs.noexec )
{
/* Invert execution result when FAIL_EXPECTED has been applied. */
@@ -905,6 +886,25 @@ static void make1d( state * pState )
printf( "...\n" );
}
push_state( &state_stack, t, NULL, T_STATE_MAKE1D )->status = status;
}
/*
* make1d() - handle command execution completion and call back make1c().
*
* exec_cmd() has completed and now all we need to do is fiddle with the status
* and call back to make1c() so it can run the next command scheduled for
* building this target or close up the target's build process in case there are
* no more commands scheduled for it. On interrupts, we bail heavily.
*/
static void make1d( state * pState )
{
TARGET * t = pState->t;
CMD * cmd = (CMD *)t->cmds;
int status = pState->status;
/* Treat failed commands as interrupts in case we were asked to stop the
* build in case of any errors.
*/