mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-10 12:40:58 +02:00
33354: when backgrounding a pipeline, close all pipe descriptors in the parent
Add test for both this and 33345+33346
This commit is contained in:
parent
74e26bf126
commit
a65fb0677c
3 changed files with 24 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2014-10-04 Barton E. Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
|
* 33354: Src/jobs.c, Test/A05execution.ztst: when backgrounding
|
||||||
|
a pipeline, close all pipe descriptors in the parent; add test
|
||||||
|
for both this and 33345+33346
|
||||||
|
|
||||||
2014-10-03 Bart Schaefer <schaefer@zsh.org>
|
2014-10-03 Bart Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
* 33346: Src/parse.c: another bit of the 33345 repair
|
* 33346: Src/parse.c: another bit of the 33345 repair
|
||||||
|
|
|
@ -1627,8 +1627,10 @@ spawnjob(void)
|
||||||
}
|
}
|
||||||
if (!hasprocs(thisjob))
|
if (!hasprocs(thisjob))
|
||||||
deletejob(jobtab + thisjob, 0);
|
deletejob(jobtab + thisjob, 0);
|
||||||
else
|
else {
|
||||||
jobtab[thisjob].stat |= STAT_LOCKED;
|
jobtab[thisjob].stat |= STAT_LOCKED;
|
||||||
|
pipecleanfilelist(jobtab[thisjob].filelist);
|
||||||
|
}
|
||||||
thisjob = -1;
|
thisjob = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -217,6 +217,21 @@ F:This similar test was triggering a reproducible failure with pipestatus.
|
||||||
F:This test checks for a file descriptor leak that could cause the left
|
F:This test checks for a file descriptor leak that could cause the left
|
||||||
F:side of a pipe to block on write after the right side has exited
|
F:side of a pipe to block on write after the right side has exited
|
||||||
|
|
||||||
|
{ setopt MONITOR } 2>/dev/null
|
||||||
|
if [[ -o MONITOR ]]
|
||||||
|
then
|
||||||
|
( while :; do print "This is a line"; done ) | () : &
|
||||||
|
sleep 1
|
||||||
|
jobs -l
|
||||||
|
else
|
||||||
|
print -u $ZTST_fd "Skipping pipe leak test, requires MONITOR option"
|
||||||
|
print "[0] 0 0"
|
||||||
|
fi
|
||||||
|
0:Bug regression: piping to anonymous function; piping to backround function
|
||||||
|
*>\[<->\] <-> <->
|
||||||
|
F:This test checks for two different bugs, a parser segfault piping to an
|
||||||
|
F:anonymous function, and a descriptor leak when backgrounding a pipeline
|
||||||
|
|
||||||
print "autoload_redir() { print Autoloaded ksh style; } >autoload.log" >autoload_redir
|
print "autoload_redir() { print Autoloaded ksh style; } >autoload.log" >autoload_redir
|
||||||
autoload -Uk autoload_redir
|
autoload -Uk autoload_redir
|
||||||
autoload_redir
|
autoload_redir
|
||||||
|
|
Loading…
Reference in a new issue