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
This commit is contained in:
Denis Vlasenko
2007-11-22 08:16:57 +00:00
parent 705eaf8b40
commit 7d75a96b15
5 changed files with 169 additions and 16 deletions

View File

@@ -0,0 +1 @@
TEST

View File

@@ -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