aboutsummaryrefslogtreecommitdiffhomepage
path: root/proc.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-02-01 22:27:15 +1000
committerGravatar axel <axel@liljencrantz.se>2006-02-01 22:27:15 +1000
commite95effb043c5e082e53db814088190f7152993f2 (patch)
tree1247cd12f5fe758a14896b2b2c47e677f7fc0246 /proc.c
parent7a1a5a6f015f7e6e8b745b3efc1b4281a063d931 (diff)
Readd the terminal flag for jobs, as not all jobs under job control should be given the terminal.
darcs-hash:20060201122715-ac50b-7efc499e8905e9898c214816d0a3468e077c7005.gz
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/proc.c b/proc.c
index 366a3b5c..38126039 100644
--- a/proc.c
+++ b/proc.c
@@ -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()) )