Readd the terminal flag for jobs, as not all jobs under job control should be given the terminal.

darcs-hash:20060201122715-ac50b-7efc499e8905e9898c214816d0a3468e077c7005.gz
This commit is contained in:
axel
2006-02-01 22:27:15 +10:00
parent 7a1a5a6f01
commit e95effb043
5 changed files with 47 additions and 32 deletions

26
proc.c
View File

@@ -880,9 +880,8 @@ void job_continue (job_t *j, int cont)
if( !job_is_completed( j ) )
{
if( j->job_control && j->fg )
if( j->terminal && j->fg )
{
/* Put the job into the foreground. */
signal_block();
if( tcsetpgrp (0, j->pgid) )
@@ -916,15 +915,28 @@ void job_continue (job_t *j, int cont)
if( cont )
{
process_t *p;
for( p=j->first_process; p; p=p->next )
p->stopped=0;
for( p=j->first_process; p; p=p->next )
if( j->job_control )
{
if (kill ( p->pid, SIGCONT) < 0)
if( killpg( j->pgid, SIGCONT ) )
{
wperror (L"kill (SIGCONT)");
wperror( L"killpg (SIGCONT)" );
return;
}
}
}
else
{
for( p=j->first_process; p; p=p->next )
{
if (kill ( p->pid, SIGCONT) < 0)
{
wperror (L"kill (SIGCONT)");
return;
}
}
}
}
@@ -1007,7 +1019,7 @@ void job_continue (job_t *j, int cont)
/*
Put the shell back in the foreground.
*/
if( j->job_control && j->fg )
if( j->terminal && j->fg )
{
signal_block();
if( tcsetpgrp (0, getpid()) )