fish-shell/tests/checks/fds.fish
ridiculousfish d6c71d77a9 Correctly cloexec file redirections
The IO cleanup left file redirections open in the child. For example,
/bin/cmd < file.txt would redirect stdin but also leave the file open.
Ensure these get closed properly.
2019-12-13 16:16:19 -08:00

25 lines
434 B
Fish

# 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 <(status current-filename)
# CHECK: 0 1 2
$helper print_fds <(status current-filename)
# CHECK: 0 1 2
$helper print_fds 3<(status current-filename)
# CHECK: 0 1 2 3