diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2024-07-13 00:59:02 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2024-07-13 00:59:02 +0200 |
commit | 14e28c18ca1a0fb87b6c73d5cb7487e80bc6713a (patch) | |
tree | 5dbbdf0d23281b1409b558e26043c4895b44a6a6 /shell/hush_test/hush-redir | |
parent | 6c38d0e9da2d4a3defd2bff9f3e00f6229e9824b (diff) | |
download | busybox-w32-14e28c18ca1a0fb87b6c73d5cb7487e80bc6713a.tar.gz busybox-w32-14e28c18ca1a0fb87b6c73d5cb7487e80bc6713a.tar.bz2 busybox-w32-14e28c18ca1a0fb87b6c73d5cb7487e80bc6713a.zip |
hush: fix "exec 3>FILE" aborting if 3 is exactly the next free fd
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush_test/hush-redir')
-rw-r--r-- | shell/hush_test/hush-redir/redir_exec2.right | 4 | ||||
-rwxr-xr-x | shell/hush_test/hush-redir/redir_exec2.tests | 11 |
2 files changed, 15 insertions, 0 deletions
diff --git a/shell/hush_test/hush-redir/redir_exec2.right b/shell/hush_test/hush-redir/redir_exec2.right new file mode 100644 index 000000000..2bdc093c9 --- /dev/null +++ b/shell/hush_test/hush-redir/redir_exec2.right | |||
@@ -0,0 +1,4 @@ | |||
1 | fd/5 | ||
2 | fd/4 | ||
3 | fd/3 | ||
4 | One:1 | ||
diff --git a/shell/hush_test/hush-redir/redir_exec2.tests b/shell/hush_test/hush-redir/redir_exec2.tests new file mode 100755 index 000000000..700a51786 --- /dev/null +++ b/shell/hush_test/hush-redir/redir_exec2.tests | |||
@@ -0,0 +1,11 @@ | |||
1 | cd /proc/$$ | ||
2 | exec 5>/dev/null | ||
3 | exec 4>/dev/null | ||
4 | exec 3>/dev/null | ||
5 | ls -1 fd/5 | ||
6 | ls -1 fd/4 | ||
7 | ls -1 fd/3 | ||
8 | exec 5>&- | ||
9 | test -e fd/5 && echo BUG | ||
10 | echo One:$? | ||
11 | |||