From 7d75a96b15327050a294b1f54981781ce6e551e2 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Thu, 22 Nov 2007 08:16:57 +0000 Subject: ash: fix bug where redirection of closed fd was leaving it open afterwards. redirect 983 1024 +41 bb_echo 276 301 +25 popredir 118 132 +14 evalcommand 1163 1176 +13 bbunpack 358 366 +8 echocmd 13 5 -8 echo_main 13 5 -8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 5/2 up/down: 101/-16) Total: 85 bytes text data bss dec hex filename 774999 962 9236 785197 bfb2d busybox_old 775084 962 9236 785282 bfb82 busybox_unstripped --- shell/ash_test/ash-redir/redir.right | 1 + shell/ash_test/ash-redir/redir.tests | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 shell/ash_test/ash-redir/redir.right create mode 100644 shell/ash_test/ash-redir/redir.tests (limited to 'shell/ash_test') diff --git a/shell/ash_test/ash-redir/redir.right b/shell/ash_test/ash-redir/redir.right new file mode 100644 index 000000000..2a02d41ce --- /dev/null +++ b/shell/ash_test/ash-redir/redir.right @@ -0,0 +1 @@ +TEST diff --git a/shell/ash_test/ash-redir/redir.tests b/shell/ash_test/ash-redir/redir.tests new file mode 100644 index 000000000..7a1a66806 --- /dev/null +++ b/shell/ash_test/ash-redir/redir.tests @@ -0,0 +1,6 @@ +# test: closed fds should stay closed +exec 1>&- +echo TEST >TEST +echo JUNK # lost: stdout is closed +cat TEST >&2 +rm TEST -- cgit v1.2.3