diff options
Diffstat (limited to '')
-rw-r--r-- | shell/ash_test/ash-redir/redir_leak.right | 6 | ||||
-rwxr-xr-x | shell/ash_test/ash-redir/redir_leak.tests | 10 |
2 files changed, 16 insertions, 0 deletions
diff --git a/shell/ash_test/ash-redir/redir_leak.right b/shell/ash_test/ash-redir/redir_leak.right new file mode 100644 index 000000000..b1c48292b --- /dev/null +++ b/shell/ash_test/ash-redir/redir_leak.right | |||
@@ -0,0 +1,6 @@ | |||
1 | 4 | ||
2 | 4 | ||
3 | 4 | ||
4 | 4 | ||
5 | 4 | ||
6 | 4 | ||
diff --git a/shell/ash_test/ash-redir/redir_leak.tests b/shell/ash_test/ash-redir/redir_leak.tests new file mode 100755 index 000000000..c8a9c6343 --- /dev/null +++ b/shell/ash_test/ash-redir/redir_leak.tests | |||
@@ -0,0 +1,10 @@ | |||
1 | # Each of these should show only four lines: | ||
2 | # fds 0,1,2 are stdio; fd 3 is open by opendir() in ls. | ||
3 | # This test detects bugs where redirects leave stray open fds. | ||
4 | |||
5 | ls -1 /proc/self/fd | wc -l | ||
6 | ls -1 /proc/self/fd >/proc/self/fd/1 | wc -l | ||
7 | ls -1 /proc/self/fd >/proc/self/fd/1 2>&1 | wc -l | ||
8 | echo "`ls -1 /proc/self/fd `" | wc -l | ||
9 | echo "`ls -1 /proc/self/fd >/proc/self/fd/1 `" | wc -l | ||
10 | echo "`ls -1 /proc/self/fd >/proc/self/fd/1 2>&1 `" | wc -l | ||