On 5/4/17 3:05 PM, Chet Ramey wrote:
>> Would the fix be backported to stable?
>
> Let me see if I can put together a patch for you to test.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/
*** ../bash-4.4/lib/sh/zread.c 2014-12-22 10:48:04.000000000 -0500
--- lib/sh/zread.c 2016-09-29 15:21:36.000000000 -0400
***************
*** 38,42 ****
--- 38,45 ----
#endif
+ extern int executing_builtin;
+
extern void check_signals_and_traps (void);
+ extern void check_signals (void);
extern int signal_is_trapped (int);
***************
*** 51,69 ****
ssize_t r;
- #if 0
- #if defined (HAVE_SIGINTERRUPT)
- if (signal_is_trapped (SIGCHLD))
- siginterrupt (SIGCHLD, 1);
- #endif
- #endif
-
while ((r = read (fd, buf, len)) < 0 && errno == EINTR)
! check_signals_and_traps (); /* XXX - should it be check_signals()?
*/
!
! #if 0
! #if defined (HAVE_SIGINTERRUPT)
! siginterrupt (SIGCHLD, 0);
! #endif
! #endif
return r;
--- 54,64 ----
ssize_t r;
while ((r = read (fd, buf, len)) < 0 && errno == EINTR)
! /* XXX - bash-5.0 */
! /* We check executing_builtin and run traps here for backwards
compatibility */
! if (executing_builtin)
! check_signals_and_traps (); /* XXX - should it be check_signals()?
*/
! else
! check_signals ();
return r;