diff --git a/exec.c b/exec.c index 30113a4f3..362ab84de 100644 --- a/exec.c +++ b/exec.c @@ -898,14 +898,19 @@ void exec( job_t *j ) { for( p=j->first_process; p; p = p->next ) { - if( (p->type == INTERNAL_BLOCK ) || - (p->type == INTERNAL_FUNCTION ) ) + if( p->type != EXTERNAL ) { if( p->next ) { needs_keepalive = 1; break; } + if( p != j->first_process ) + { + needs_keepalive = 1; + break; + } + } }