mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
tests/io.sh: add proc subst FD leak test (re: ab5dedde
)
This commit is contained in:
parent
d7c90eadc3
commit
f0be4d95e8
1 changed files with 14 additions and 0 deletions
|
@ -618,5 +618,19 @@ fi
|
|||
(exec 7>bad.txt; "$SHELL" -c 'print bad >&7' 2>/dev/null)
|
||||
[[ $(<bad.txt) == '' ]] || err_exit 'File descriptors > 2 inherited without POSIX mode' "(got $actual)"
|
||||
|
||||
# ======
|
||||
# File descriptor leak with process substitution
|
||||
err=$(
|
||||
ulimit -n 15 || exit 0
|
||||
fdUser() {
|
||||
:
|
||||
}
|
||||
set +x
|
||||
for ((i=1; i<10; i++))
|
||||
do fdUser <(:) >(:) || exit
|
||||
done 2>&1
|
||||
) || err_exit 'Process substitution leaks file descriptors when used as argument to function' \
|
||||
"(got $(printf %q "$err"))"
|
||||
|
||||
# ======
|
||||
exit $((Errors<125?Errors:125))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue