summaryrefslogtreecommitdiff
path: root/shell/ash_test/ash-signals/signal8.tests
diff options
context:
space:
mode:
authorDenys Vlasenko2010-09-25 17:15:13 +0200
committerDenys Vlasenko2010-09-25 17:15:13 +0200
commitb563f62bbb1c9a6d931924f8fd7c3e52bb3d5875 (patch)
tree617e5a8de03257f9695fd10a496601c607f6803d /shell/ash_test/ash-signals/signal8.tests
parent5b3151c201f4a67e998ec054d653e8177679d505 (diff)
downloadbusybox-b563f62bbb1c9a6d931924f8fd7c3e52bb3d5875.zip
busybox-b563f62bbb1c9a6d931924f8fd7c3e52bb3d5875.tar.gz
ash: fix signal and "set -e" interaction
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash_test/ash-signals/signal8.tests')
-rwxr-xr-xshell/ash_test/ash-signals/signal8.tests18
1 files changed, 18 insertions, 0 deletions
diff --git a/shell/ash_test/ash-signals/signal8.tests b/shell/ash_test/ash-signals/signal8.tests
new file mode 100755
index 0000000..731af74
--- /dev/null
+++ b/shell/ash_test/ash-signals/signal8.tests
@@ -0,0 +1,18 @@
+"$THIS_SH" -c '
+exit_func() {
+ echo "Removing traps"
+ trap - EXIT TERM INT
+ echo "End of exit_func"
+}
+set -e
+trap exit_func EXIT TERM INT
+sleep 2
+exit 77
+' &
+
+sleep 1
+# BUG: ash kills -PGRP, but in non-interactive shell we do not create pgrps!
+# In this case, bash kills by PID, not PGRP.
+kill -TERM %1
+wait
+echo Done: $?