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

9014c4
From c9f1b04651dae16e33f0aa8974c5122e26b362ae Mon Sep 17 00:00:00 2001
9014c4
From: Chet Ramey <chet.ramey@case.edu>
9014c4
Date: Mon, 29 Jan 2018 16:04:20 -0500
9014c4
Subject: [PATCH] Bash-4.4 patch 16
9014c4
9014c4
---
9014c4
 lib/sh/zread.c | 23 +++++++++--------------
9014c4
 patchlevel.h   |  2 +-
9014c4
 2 files changed, 10 insertions(+), 15 deletions(-)
9014c4
9014c4
diff --git a/lib/sh/zread.c b/lib/sh/zread.c
9014c4
index 868f9705..496f20b8 100644
9014c4
--- a/lib/sh/zread.c
9014c4
+++ b/lib/sh/zread.c
9014c4
@@ -37,7 +37,10 @@ extern int errno;
9014c4
 #  define SEEK_CUR 1
9014c4
 #endif
9014c4
 
9014c4
+extern int executing_builtin;
9014c4
+
9014c4
 extern void check_signals_and_traps (void);
9014c4
+extern void check_signals (void);
9014c4
 extern int signal_is_trapped (int);
9014c4
 
9014c4
 /* Read LEN bytes from FD into BUF.  Retry the read on EINTR.  Any other
9014c4
@@ -50,21 +53,13 @@ zread (fd, buf, len)
9014c4
 {
9014c4
   ssize_t r;
9014c4
 
9014c4
-#if 0
9014c4
-#if defined (HAVE_SIGINTERRUPT)
9014c4
-  if (signal_is_trapped (SIGCHLD))
9014c4
-    siginterrupt (SIGCHLD, 1);
9014c4
-#endif
9014c4
-#endif
9014c4
-
9014c4
   while ((r = read (fd, buf, len)) < 0 && errno == EINTR)
9014c4
-    check_signals_and_traps ();	/* XXX - should it be check_signals()? */
9014c4
-
9014c4
-#if 0 
9014c4
-#if defined (HAVE_SIGINTERRUPT)
9014c4
-  siginterrupt (SIGCHLD, 0);
9014c4
-#endif
9014c4
-#endif
9014c4
+    /* XXX - bash-5.0 */
9014c4
+    /* We check executing_builtin and run traps here for backwards compatibility */
9014c4
+    if (executing_builtin)
9014c4
+      check_signals_and_traps ();	/* XXX - should it be check_signals()? */
9014c4
+    else
9014c4
+      check_signals ();
9014c4
 
9014c4
   return r;
9014c4
 }
9014c4
diff --git a/patchlevel.h b/patchlevel.h
9014c4
index 6e9ed3fc..9074f4dd 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 15
9014c4
+#define PATCHLEVEL 16
9014c4
 
9014c4
 #endif /* _PATCHLEVEL_H_ */
9014c4
-- 
9014c4
2.13.6
9014c4