aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--proc.c16
-rw-r--r--proc.h2
2 files changed, 8 insertions, 10 deletions
diff --git a/proc.c b/proc.c
index 5c60c5b2..f3c5eebc 100644
--- a/proc.c
+++ b/proc.c
@@ -257,7 +257,7 @@ int job_is_stopped( const job_t *j )
/*
- Return true if all processes in the job have completed.
+ Return true if the last processes in the job has completed.
\param j the job to test
*/
@@ -265,14 +265,11 @@ int job_is_completed( const job_t *j )
{
process_t *p;
- for (p = j->first_process; p; p = p->next)
- {
- if (!p->completed)
- {
- return 0;
- }
- }
- return 1;
+ for (p = j->first_process; p->next; p = p->next)
+ ;
+
+ return p->completed;
+
}
/**
@@ -1013,6 +1010,7 @@ void job_continue (job_t *j, int cont)
signal_unblock();
}
}
+
}
void proc_sanity_check()
diff --git a/proc.h b/proc.h
index 9f557b33..7dbe02ad 100644
--- a/proc.h
+++ b/proc.h
@@ -276,7 +276,7 @@ job_t *job_get_from_pid(int pid);
int job_is_stopped( const job_t *j );
/**
- Tests if the job has completed
+ Tests if the job has completed, i.e. if the last process of the pipeline has ended.
*/
int job_is_completed( const job_t *j );