busybox/shell/hush_test/hush-redir/redir.tests
Denys Vlasenko 621fc50e83 hush: fix a case when redirect to a closed fd #1 is not restoring (closing) it
function                                             old     new   delta
setup_redirects                                      200     245     +45
append_squirrel                                        -      41     +41
save_fds_on_redirect                                 256     221     -35
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/1 up/down: 86/-35)             Total: 51 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-07-24 12:42:17 +02:00

7 lines
120 B
Plaintext
Executable File

# test: closed fds should stay closed
exec 1>&-
echo TEST >TEST
echo JUNK # lost: stdout is closed
cat TEST >&2
rm TEST