diff --git a/v2/engine/execunix.c b/v2/engine/execunix.c index 37cbfb800..04fdb3300 100644 --- a/v2/engine/execunix.c +++ b/v2/engine/execunix.c @@ -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 ] ); } diff --git a/v2/engine/make1.c b/v2/engine/make1.c index 47c091c36..c30b3b8fe 100644 --- a/v2/engine/make1.c +++ b/v2/engine/make1.c @@ -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. */