aboutsummaryrefslogtreecommitdiffstats
path: root/jobs.c
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2011-11-21 20:49:12 -0500
committerChet Ramey <chet.ramey@case.edu>2011-11-21 20:49:12 -0500
commit89a92869e56aba4e4cab2d639c00a86f0545c862 (patch)
treee1cd4da50318af8ab1f3141d39d4b0b8e1e7c500 /jobs.c
parent17345e5ad288f7543b77b23a25aa380eacc279f2 (diff)
downloadandroid_external_bash-89a92869e56aba4e4cab2d639c00a86f0545c862.tar.gz
android_external_bash-89a92869e56aba4e4cab2d639c00a86f0545c862.tar.bz2
android_external_bash-89a92869e56aba4e4cab2d639c00a86f0545c862.zip
Bash-4.0 patchlevel 38
Diffstat (limited to 'jobs.c')
-rw-r--r--jobs.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/jobs.c b/jobs.c
index 24d98af..d8bb7ae 100644
--- a/jobs.c
+++ b/jobs.c
@@ -442,7 +442,7 @@ restore_pipeline (discard)
old_pipeline = the_pipeline;
the_pipeline = saved_pipeline;
already_making_children = saved_already_making_children;
- if (discard)
+ if (discard && old_pipeline)
discard_pipeline (old_pipeline);
}
@@ -4202,4 +4202,23 @@ close_pgrp_pipe ()
sh_closepipe (pgrp_pipe);
}
+void
+save_pgrp_pipe (p, clear)
+ int *p;
+ int clear;
+{
+ p[0] = pgrp_pipe[0];
+ p[1] = pgrp_pipe[1];
+ if (clear)
+ pgrp_pipe[0] = pgrp_pipe[1] = -1;
+}
+
+void
+restore_pgrp_pipe (p)
+ int *p;
+{
+ pgrp_pipe[0] = p[0];
+ pgrp_pipe[1] = p[1];
+}
+
#endif /* PGRP_PIPE */