summaryrefslogtreecommitdiff
path: root/jobs.c
diff options
context:
space:
mode:
authorJari Aalto <jari.aalto@cante.net>2004-11-09 21:37:25 +0000
committerJari Aalto <jari.aalto@cante.net>2009-09-12 16:46:57 +0000
commiteb87367179effbe5f430236db8259006d71438b7 (patch)
tree012cd9de789fea49510f8e25118acf2be9bfa2ed /jobs.c
parentb80f6443b6b7b620c7272664c66ecb0b120a0998 (diff)
downloadbash-eb87367179effbe5f430236db8259006d71438b7.tar.gz
Imported from ../bash-3.0.16.tar.gz.
Diffstat (limited to 'jobs.c')
-rw-r--r--jobs.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/jobs.c b/jobs.c
index 8418267b..b10a8a22 100644
--- a/jobs.c
+++ b/jobs.c
@@ -1778,8 +1778,13 @@ raw_job_exit_status (job)
if (pipefail_opt)
{
fail = 0;
- for (p = jobs[job]->pipe; p->next != jobs[job]->pipe; p = p->next)
- if (p->status != EXECUTION_SUCCESS) fail = p->status;
+ p = jobs[job]->pipe;
+ do
+ {
+ if (p->status != EXECUTION_SUCCESS) fail = p->status;
+ p = p->next;
+ }
+ while (p != jobs[job]->pipe);
return fail;
}