rcolebaugh / rpms / bash

Forked from rpms/bash 2 years ago
Clone

Blame SOURCES/bash-4.4-patch-4.patch

9014c4
From 2965eca924466a48c5597ac5c6c86d470e718908 Mon Sep 17 00:00:00 2001
9014c4
From: Chet Ramey <chet.ramey@case.edu>
9014c4
Date: Mon, 14 Nov 2016 14:27:35 -0500
9014c4
Subject: [PATCH] Bash-4.4 patch 4
9014c4
9014c4
---
9014c4
 jobs.c       | 15 +++++++++++++++
9014c4
 jobs.h       |  1 +
9014c4
 patchlevel.h |  2 +-
9014c4
 subst.c      |  5 +----
9014c4
 4 files changed, 18 insertions(+), 5 deletions(-)
9014c4
9014c4
diff --git a/jobs.c b/jobs.c
9014c4
index cef3c79..fc96603 100644
9014c4
--- a/jobs.c
9014c4
+++ b/jobs.c
9014c4
@@ -453,6 +453,21 @@ cleanup_the_pipeline ()
9014c4
     discard_pipeline (disposer);
9014c4
 }
9014c4
 
9014c4
+void
9014c4
+discard_last_procsub_child ()
9014c4
+{
9014c4
+  PROCESS *disposer;
9014c4
+  sigset_t set, oset;
9014c4
+
9014c4
+  BLOCK_CHILD (set, oset);
9014c4
+  disposer = last_procsub_child;
9014c4
+  last_procsub_child = (PROCESS *)NULL;
9014c4
+  UNBLOCK_CHILD (oset);
9014c4
+
9014c4
+  if (disposer)
9014c4
+    discard_pipeline (disposer);
9014c4
+}
9014c4
+
9014c4
 struct pipeline_saver *
9014c4
 alloc_pipeline_saver ()
9014c4
 {
9014c4
diff --git a/jobs.h b/jobs.h
9014c4
index 4ba3513..6df0607 100644
9014c4
--- a/jobs.h
9014c4
+++ b/jobs.h
9014c4
@@ -190,6 +190,7 @@ extern JOB **jobs;
9014c4
 extern void making_children __P((void));
9014c4
 extern void stop_making_children __P((void));
9014c4
 extern void cleanup_the_pipeline __P((void));
9014c4
+extern void discard_last_procsub_child __P((void));
9014c4
 extern void save_pipeline __P((int));
9014c4
 extern PROCESS *restore_pipeline __P((int));
9014c4
 extern void start_pipeline __P((void));
9014c4
diff --git a/patchlevel.h b/patchlevel.h
9014c4
index e7e960c..c059f0b 100644
9014c4
--- a/patchlevel.h
9014c4
+++ b/patchlevel.h
9014c4
@@ -25,6 +25,6 @@
9014c4
    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
9014c4
    looks for to find the patch level (for the sccs version string). */
9014c4
 
9014c4
-#define PATCHLEVEL 3
9014c4
+#define PATCHLEVEL 4
9014c4
 
9014c4
 #endif /* _PATCHLEVEL_H_ */
9014c4
diff --git a/subst.c b/subst.c
9014c4
index 4d498ef..298187d 100644
9014c4
--- a/subst.c
9014c4
+++ b/subst.c
9014c4
@@ -5808,10 +5808,7 @@ process_substitute (string, open_for_read_in_child)
9014c4
     {
9014c4
 #if defined (JOB_CONTROL)
9014c4
       if (last_procsub_child)
9014c4
-	{
9014c4
-	  discard_pipeline (last_procsub_child);
9014c4
-	  last_procsub_child = (PROCESS *)NULL;
9014c4
-	}
9014c4
+	discard_last_procsub_child ();
9014c4
       last_procsub_child = restore_pipeline (0);
9014c4
 #endif
9014c4
 
9014c4
-- 
9014c4
2.9.3
9014c4