mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-24 15:04:13 +00:00
Another Red Hat patch. "Prior to this update, the result of a command substitution was lost if a file descriptor used for the substitution was previously explicitly closed. With this update, ksh no longer reuses file descriptors that were closed during the execution of a command substitution. Now, command substitutions work as expected in the described situation." Prior discussion: https://bugzilla.redhat.com/1116072 Original patch: https://src.fedoraproject.org/rpms/ksh/blob/642af4d6/f/ksh-20140929-safefd.patch src/cmd/ksh93/include/io.h, src/cmd/ksh93/sh/io.c: - Add sh_iosafefd() function to get a file descriptor that is not in use or otherwise occupied (including marked as closed). src/cmd/ksh93/sh/subshell.c: sh_subshell(): - Use that function to obtain a safe FD upon restoring state when exiting a command substitution. I don't really know the how and why -- all that I/O magic is still beyond me and the code is uncommented as usual. src/cmd/ksh93/tests/subshell.sh: - Add regression test from the reproducer in the bug, reduced to the minimum necessary. |
||
---|---|---|
.. | ||
args.c | ||
arith.c | ||
array.c | ||
defs.c | ||
deparse.c | ||
expand.c | ||
fault.c | ||
fcin.c | ||
init.c | ||
io.c | ||
jobs.c | ||
lex.c | ||
macro.c | ||
main.c | ||
name.c | ||
nvdisc.c | ||
nvtree.c | ||
nvtype.c | ||
parse.c | ||
path.c | ||
pmain.c | ||
shcomp.c | ||
streval.c | ||
string.c | ||
subshell.c | ||
suid_exec.c | ||
tdump.c | ||
timers.c | ||
trestore.c | ||
waitevent.c | ||
xec.c |