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 ./test-select-fd${EXEEXT} w 1 > t-select-out.out 2> t-select-out.tmp
12 test `cat t-select-out.tmp` = "1" || exit 1
16 ( { echo abc; ./test-select-fd${EXEEXT} w 1; } | { sleep 1; cat; } ) > /dev/null 2> t-select-out.tmp
17 test `cat t-select-out.tmp` = "0" || exit 1
19 ( { sleep 1; echo abc; ./test-select-fd${EXEEXT} w 1; } | cat) > /dev/null 2> t-select-out.tmp
20 test `cat t-select-out.tmp` = "1" || exit 1
24 ./test-select-fd${EXEEXT} w 1 > /dev/null 2> t-select-out.tmp
25 test `cat t-select-out.tmp` = "1" || exit 1