diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2024-07-13 01:47:49 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2024-07-13 02:13:28 +0200 |
commit | 23da5c4b716b92524240c6f81c2e2474c1825cfc (patch) | |
tree | 1acec3d32a91a45d2e182d0b7ffa643367935ffe /shell/hush_test/hush-redir | |
parent | 14e28c18ca1a0fb87b6c73d5cb7487e80bc6713a (diff) | |
download | busybox-w32-23da5c4b716b92524240c6f81c2e2474c1825cfc.tar.gz busybox-w32-23da5c4b716b92524240c6f81c2e2474c1825cfc.tar.bz2 busybox-w32-23da5c4b716b92524240c6f81c2e2474c1825cfc.zip |
hush: do not exit interactive shell on some redirection errors
$ echo >&99
hush: dup2(99,1): Bad file descriptor
$ echo >&9999
hush: fcntl(1,F_DUPFD,10000): Invalid argument
$ echo 2>/dev/tty 10>&9999
hush: fcntl(10,F_DUPFD,10000): Invalid argument
$ still alive!_
function old new delta
static.setup_redirects 334 394 +60
.rodata 105661 105712 +51
dup_CLOEXEC 49 79 +30
save_fd_on_redirect 263 277 +14
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/0 up/down: 155/0) Total: 155 bytes
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/redir3.right | 3 | ||||
-rwxr-xr-x | shell/hush_test/hush-redir/redir_exec2.tests | 1 | ||||
-rw-r--r-- | shell/hush_test/hush-redir/redir_to_bad_fd.right | 3 | ||||
-rw-r--r-- | shell/hush_test/hush-redir/redir_to_bad_fd255.right | 3 | ||||
-rw-r--r-- | shell/hush_test/hush-redir/redir_to_bad_fd3.right | 3 |
5 files changed, 8 insertions, 5 deletions
diff --git a/shell/hush_test/hush-redir/redir3.right b/shell/hush_test/hush-redir/redir3.right index e3c878b7d..d49237c42 100644 --- a/shell/hush_test/hush-redir/redir3.right +++ b/shell/hush_test/hush-redir/redir3.right | |||
@@ -1,2 +1,3 @@ | |||
1 | TEST | 1 | TEST |
2 | hush: can't duplicate file descriptor: Bad file descriptor | 2 | hush: dup2(9,1): Bad file descriptor |
3 | Output to fd#9: 1 | ||
diff --git a/shell/hush_test/hush-redir/redir_exec2.tests b/shell/hush_test/hush-redir/redir_exec2.tests index 700a51786..0af767592 100755 --- a/shell/hush_test/hush-redir/redir_exec2.tests +++ b/shell/hush_test/hush-redir/redir_exec2.tests | |||
@@ -8,4 +8,3 @@ ls -1 fd/3 | |||
8 | exec 5>&- | 8 | exec 5>&- |
9 | test -e fd/5 && echo BUG | 9 | test -e fd/5 && echo BUG |
10 | echo One:$? | 10 | echo One:$? |
11 | |||
diff --git a/shell/hush_test/hush-redir/redir_to_bad_fd.right b/shell/hush_test/hush-redir/redir_to_bad_fd.right index 936911ce5..4fc51cc93 100644 --- a/shell/hush_test/hush-redir/redir_to_bad_fd.right +++ b/shell/hush_test/hush-redir/redir_to_bad_fd.right | |||
@@ -1 +1,2 @@ | |||
1 | hush: can't duplicate file descriptor: Bad file descriptor | 1 | hush: dup2(10,1): Bad file descriptor |
2 | OK | ||
diff --git a/shell/hush_test/hush-redir/redir_to_bad_fd255.right b/shell/hush_test/hush-redir/redir_to_bad_fd255.right index 936911ce5..baa2959ca 100644 --- a/shell/hush_test/hush-redir/redir_to_bad_fd255.right +++ b/shell/hush_test/hush-redir/redir_to_bad_fd255.right | |||
@@ -1 +1,2 @@ | |||
1 | hush: can't duplicate file descriptor: Bad file descriptor | 1 | hush: dup2(255,1): Bad file descriptor |
2 | OK | ||
diff --git a/shell/hush_test/hush-redir/redir_to_bad_fd3.right b/shell/hush_test/hush-redir/redir_to_bad_fd3.right index 936911ce5..5e54abc0a 100644 --- a/shell/hush_test/hush-redir/redir_to_bad_fd3.right +++ b/shell/hush_test/hush-redir/redir_to_bad_fd3.right | |||
@@ -1 +1,2 @@ | |||
1 | hush: can't duplicate file descriptor: Bad file descriptor | 1 | hush: fd#3 is not open |
2 | OK | ||