sh: Add a test for break from a trap action.

This commit is contained in:
Jilles Tjoelker 2010-08-18 20:26:50 +00:00
parent c3f0bdc66b
commit 44510b41ff
2 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,12 @@
# $FreeBSD$
# It is not immediately obvious that this should work, and someone probably
# relies on it.
while :; do
trap 'break' USR1
kill -USR1 $$
echo bad
exit 1
done
echo good

View File

@ -0,0 +1 @@
good