mirror of https://github.com/n-hys/bash.git
Bash-5.0 patch 7: fix exec builtin leaving the terminal in the wrong process group
This commit is contained in:
parent
dfd2cc6ac5
commit
3ba697465b
12
jobs.c
12
jobs.c
|
@ -4837,15 +4837,13 @@ void
|
||||||
end_job_control ()
|
end_job_control ()
|
||||||
{
|
{
|
||||||
if (job_control)
|
if (job_control)
|
||||||
{
|
terminate_stopped_jobs ();
|
||||||
terminate_stopped_jobs ();
|
|
||||||
|
|
||||||
if (original_pgrp >= 0)
|
if (original_pgrp >= 0 && terminal_pgrp != original_pgrp)
|
||||||
give_terminal_to (original_pgrp, 1);
|
give_terminal_to (original_pgrp, 1);
|
||||||
}
|
|
||||||
|
|
||||||
if (original_pgrp >= 0)
|
if (original_pgrp >= 0 && setpgid (0, original_pgrp) == 0)
|
||||||
setpgid (0, original_pgrp);
|
shell_pgrp = original_pgrp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Restart job control by closing shell tty and reinitializing. This is
|
/* Restart job control by closing shell tty and reinitializing. This is
|
||||||
|
|
|
@ -25,6 +25,6 @@
|
||||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
||||||
looks for to find the patch level (for the sccs version string). */
|
looks for to find the patch level (for the sccs version string). */
|
||||||
|
|
||||||
#define PATCHLEVEL 6
|
#define PATCHLEVEL 7
|
||||||
|
|
||||||
#endif /* _PATCHLEVEL_H_ */
|
#endif /* _PATCHLEVEL_H_ */
|
||||||
|
|
Loading…
Reference in New Issue