b92f7d
From ce23728687ce9e584333367075c9deef413553fa Mon Sep 17 00:00:00 2001
b92f7d
From: Chet Ramey <chet.ramey@case.edu>
b92f7d
Date: Tue, 4 May 2021 14:31:53 -0400
b92f7d
Subject: [PATCH] Bash-5.1 patch 8: clean up FIFOs created by redirections in
b92f7d
 child processes
b92f7d
b92f7d
---
b92f7d
 execute_cmd.c | 8 +++++++-
b92f7d
 patchlevel.h  | 2 +-
b92f7d
 2 files changed, 8 insertions(+), 2 deletions(-)
b92f7d
b92f7d
diff --git a/execute_cmd.c b/execute_cmd.c
b92f7d
index d2a0dd71..90129e06 100644
b92f7d
--- a/execute_cmd.c
b92f7d
+++ b/execute_cmd.c
b92f7d
@@ -5556,11 +5556,17 @@ execute_disk_command (words, redirects, command_line, pipe_in, pipe_out,
b92f7d
 #if defined (PROCESS_SUBSTITUTION)
b92f7d
 	  /* Try to remove named pipes that may have been created as the
b92f7d
 	     result of redirections. */
b92f7d
-	  unlink_fifo_list ();
b92f7d
+	  unlink_all_fifos ();
b92f7d
 #endif /* PROCESS_SUBSTITUTION */
b92f7d
 	  exit (EXECUTION_FAILURE);
b92f7d
 	}
b92f7d
 
b92f7d
+#if defined (PROCESS_SUBSTITUTION) && !defined (HAVE_DEV_FD)
b92f7d
+      /* This should only contain FIFOs created as part of redirection
b92f7d
+	 expansion. */
b92f7d
+      unlink_all_fifos ();
b92f7d
+#endif
b92f7d
+
b92f7d
       if (async)
b92f7d
 	interactive = old_interactive;
b92f7d
 
b92f7d
diff --git a/patchlevel.h b/patchlevel.h
b92f7d
index c5ed66ab..10fde2ee 100644
b92f7d
--- a/patchlevel.h
b92f7d
+++ b/patchlevel.h
b92f7d
@@ -25,6 +25,6 @@
b92f7d
    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
b92f7d
    looks for to find the patch level (for the sccs version string). */
b92f7d
 
b92f7d
-#define PATCHLEVEL 7
b92f7d
+#define PATCHLEVEL 8
b92f7d
 
b92f7d
 #endif /* _PATCHLEVEL_H_ */
b92f7d
-- 
b92f7d
2.29.2
b92f7d