2 # Test select() on file descriptors opened for writing.
5 trap 'rm -fr $tmpfiles' 1 2 3 15
7 tmpfiles="$tmpfiles t-select-out.out t-select-out.tmp"
11 rm -f t-select-out.tmp
12 ./test-select-fd${EXEEXT} w 1 t-select-out.tmp > t-select-out.out
13 test `cat t-select-out.tmp` = "1" || exit 1
17 rm -f t-select-out.tmp
18 ( { echo abc; ./test-select-fd${EXEEXT} w 1 t-select-out.tmp; } | { sleep 1; cat; } ) > /dev/null
19 test `cat t-select-out.tmp` = "0" || exit 1
21 rm -f t-select-out.tmp
22 ( { sleep 1; echo abc; ./test-select-fd${EXEEXT} w 1 t-select-out.tmp; } | cat) > /dev/null
23 test `cat t-select-out.tmp` = "1" || exit 1
27 rm -f t-select-out.tmp
28 ./test-select-fd${EXEEXT} w 1 t-select-out.tmp > /dev/null
29 test `cat t-select-out.tmp` = "1" || exit 1