ash: fix a bug where redirection fds were not closed afterwards.
authorDenis Vlasenko <vda.linux@googlemail.com>
Thu, 24 Jul 2008 19:46:38 +0000 (19:46 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Thu, 24 Jul 2008 19:46:38 +0000 (19:46 -0000)
commit5a867317bb1cbf36d396d9cdb552212607dcc2b1
treee8c01f8c4f8242694db730eed60a3616e86f3a48
parent6fbb43bc3c14fc30030cae77db51c322bece30ab
ash: fix a bug where redirection fds were not closed afterwards.
 optimize close+fcntl(DUPFD) into dup2. add testsuites.

function                                             old     new   delta
copyfd                                                47      68     +21
argstr                                              1311    1298     -13
popredir                                             148     131     -17
redirect                                            1139    1107     -32
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/3 up/down: 21/-62)            Total: -41 bytes
shell/ash.c
shell/ash_test/ash-redir/redir2.right [new file with mode: 0644]
shell/ash_test/ash-redir/redir2.tests [new file with mode: 0755]
shell/ash_test/ash-redir/redir3.right [new file with mode: 0644]
shell/ash_test/ash-redir/redir3.tests [new file with mode: 0755]
shell/ash_test/run-all