mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Fix crash in backtick comsubs with job control on (rhbz#825520)
This imports another fix from Red Hat/Fedora. Original patch:
642af4d6/f/ksh-20120801-crash.patch
src/cmd/ksh93/include/jobs.h,
src/cmd/ksh93/sh/jobs.c,
src/cmd/ksh93/sh/subshell.c,
src/cmd/ksh93/sh/xec.c:
- Import the Red Hat fix with these differences:
- Rename the 'hack1_waitall' variable to 'bktick_waitall' and add
a comment describing what it's for.
- Remove unused 'pipefail' variable.
src/cmd/ksh93/tests/basic.sh:
- Regression test from reproducer given in the Red Hat bug report.
- Add special handling to SIGKILL it, as it might freeze hard.
This commit is contained in:
parent
f7ffaaba17
commit
ce68e1be37
7 changed files with 32 additions and 3 deletions
|
|
@ -524,7 +524,10 @@ Sfio_t *sh_subshell(Shell_t *shp,Shnode_t *t, volatile int flags, int comsub)
|
|||
sp->comsub = shp->comsub;
|
||||
shp->subshare = comsub==2 || (comsub==1 && sh_isoption(SH_SUBSHARE));
|
||||
if(comsub)
|
||||
{
|
||||
shp->comsub = comsub;
|
||||
job.bktick_waitall = (comsub==1);
|
||||
}
|
||||
if(!comsub || !shp->subshare)
|
||||
{
|
||||
struct subshell *xp;
|
||||
|
|
@ -655,6 +658,7 @@ Sfio_t *sh_subshell(Shell_t *shp,Shnode_t *t, volatile int flags, int comsub)
|
|||
}
|
||||
else
|
||||
{
|
||||
job.bktick_waitall = 0;
|
||||
if(comsub!=1 && shp->spid)
|
||||
{
|
||||
job_wait(shp->spid);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue