sh: Add another simple test for the wait builtin.
This commit is contained in:
parent
772753491b
commit
440bbebcc9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=215547
21
tools/regression/bin/sh/builtins/wait3.0
Normal file
21
tools/regression/bin/sh/builtins/wait3.0
Normal file
@ -0,0 +1,21 @@
|
||||
# $FreeBSD$
|
||||
|
||||
failures=
|
||||
failure() {
|
||||
echo "Error at line $1" >&2
|
||||
failures=x$failures
|
||||
}
|
||||
|
||||
T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX)
|
||||
trap 'rm -rf $T' 0
|
||||
cd $T || exit 3
|
||||
mkfifo fifo1
|
||||
for i in 1 2 3 4 5 6 7 8 9 10; do
|
||||
exit $i 4<fifo1 &
|
||||
done
|
||||
exec 3>fifo1
|
||||
wait || failure $LINENO
|
||||
(echo >&3) 2>/dev/null && failure $LINENO
|
||||
wait || failure $LINENO
|
||||
|
||||
test -z "$failures"
|
Loading…
Reference in New Issue
Block a user