# RUN: %fish -C "set helper %fish_test_helper" %s # Check that we don't leave stray FDs. $helper print_fds # CHECK: 0 1 2 $helper print_fds 0>&- # CHECK: 1 2 $helper print_fds 0>&- 2>&- # CHECK: 1 false | $helper print_fds 0>&- # CHECK: 0 1 2 $helper print_fds &2 # CHECK: 0 1 2 5 # This attempts to trip a case where the file opened in fish # has the same fd as the redirection. In this case, the dup2 # does not clear the CLO_EXEC bit. $helper print_fds 4