Bash-5.2 patch 28: fix terminal pgrp handling in DEBUG trap

This commit is contained in:
Chet Ramey
2024-08-01 11:33:15 -04:00
parent da16dd1e74
commit 7440bd8ba5
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -25,6 +25,6 @@
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
looks for to find the patch level (for the sccs version string). */
#define PATCHLEVEL 27
#define PATCHLEVEL 28
#endif /* _PATCHLEVEL_H_ */
+3 -1
View File
@@ -1216,7 +1216,9 @@ run_debug_trap ()
close_pgrp_pipe ();
restore_pgrp_pipe (save_pipe);
# endif
if (pipeline_pgrp > 0 && ((subshell_environment & (SUBSHELL_ASYNC|SUBSHELL_PIPE)) == 0))
/* If the trap command gave the terminal to another process group,
restore it. XXX - check running_in_background? */
if (job_control && pipeline_pgrp > 0 && ((subshell_environment & (SUBSHELL_ASYNC|SUBSHELL_PIPE)) == 0))
give_terminal_to (pipeline_pgrp, 1);
notify_and_cleanup ();