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