diff options
author | Denis Vlasenko | 2008-02-13 18:09:56 +0000 |
---|---|---|
committer | Denis Vlasenko | 2008-02-13 18:09:56 +0000 |
commit | 81887e23429bacb1d1f330f5aea706192901932a (patch) | |
tree | 1c3d7e3936eab3ec8139a45814478f26b71252bf /shell/ash_test/ash-signals/signal1.tests | |
parent | 23ffb6a4a2a01fe41abe4e42d46fa16bdc2603fd (diff) | |
download | busybox-81887e23429bacb1d1f330f5aea706192901932a.zip busybox-81887e23429bacb1d1f330f5aea706192901932a.tar.gz |
ash: add a testcase for recently fixed signal bug
Diffstat (limited to 'shell/ash_test/ash-signals/signal1.tests')
-rwxr-xr-x | shell/ash_test/ash-signals/signal1.tests | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/shell/ash_test/ash-signals/signal1.tests b/shell/ash_test/ash-signals/signal1.tests new file mode 100755 index 0000000..49a395b --- /dev/null +++ b/shell/ash_test/ash-signals/signal1.tests @@ -0,0 +1,24 @@ +sleeping=true + +trap "echo got signal" USR1 + +for try in 1 2 3 4 5; do + kill -USR1 $$ + sleep 1 + echo sent $try signal +done & + +sleep 10 & + +while $sleeping; do + trap + if wait %%; then + echo sleep completed + sleeping=false + elif [ $? == 127 ]; then + echo no sleep tonite + sleeping=false + else + echo sleep interrupted; + fi +done |