redir_leak.tests 441 B

12345678910
  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. ls -1 /proc/self/fd | wc -l
  5. ls -1 /proc/self/fd >/proc/self/fd/1 | wc -l
  6. ls -1 /proc/self/fd >/proc/self/fd/1 2>&1 | wc -l
  7. echo "`ls -1 /proc/self/fd `" | wc -l
  8. echo "`ls -1 /proc/self/fd >/proc/self/fd/1 `" | wc -l
  9. echo "`ls -1 /proc/self/fd >/proc/self/fd/1 2>&1 `" | wc -l