summaryrefslogtreecommitdiff
path: root/regress/bin/ksh/trap.t
diff options
context:
space:
mode:
Diffstat (limited to 'regress/bin/ksh/trap.t')
-rw-r--r--regress/bin/ksh/trap.t41
1 files changed, 22 insertions, 19 deletions
diff --git a/regress/bin/ksh/trap.t b/regress/bin/ksh/trap.t
index 8cead8bcd64..35c982da657 100644
--- a/regress/bin/ksh/trap.t
+++ b/regress/bin/ksh/trap.t
@@ -1,4 +1,4 @@
-# $OpenBSD: trap.t,v 1.4 2022/10/15 15:29:45 kn Exp $
+# $OpenBSD: trap.t,v 1.5 2022/10/16 10:19:02 kn Exp $
#
# Check that I/O redirection failure triggers the ERR trap.
@@ -55,7 +55,7 @@ expected-exit: e != 0
# Check that traps are run in the same order in which they were triggered.
#
-name: EXIT-always-runs
+name: failed-ERR-runs-EXIT
# XXX remove once bin/ksh/main.c r1.52 is backed out *AND* a new fix is in
# XXX enable once bin/ksh/main.c r1.52 is backed out
#expected-fail: yes
@@ -73,22 +73,6 @@ expected-exit: e != 0
---
-name: signal-handling-is-no-error
-description:
- Check that gracefully handling a signal is not treated as error.
-arguments: !-e!
-stdin:
- trap 'echo ERR' ERR
- trap 'echo EXIT' EXIT
- trap 'echo USR1' USR1
- kill -USR1 $$
-expected-stdout:
- USR1
- EXIT
-expected-exit: e == 0
----
-
-
name: errexit-aborts-EXIT
# XXX remove once bin/ksh/main.c r1.52 is backed out
expected-fail: yes
@@ -118,4 +102,23 @@ expected-stdout:
EXIT
ERR
expected-exit: e != 0
- ---
+---
+
+#
+# Check that the errexit option does not interfere with signal handler traps.
+#
+
+name: handled-signal-is-no-error
+description:
+ Check that gracefully handling a signal is not treated as error.
+arguments: !-e!
+stdin:
+ trap 'echo ERR' ERR
+ trap 'echo EXIT' EXIT
+ trap 'echo USR1' USR1
+ kill -USR1 $$
+expected-stdout:
+ USR1
+ EXIT
+expected-exit: e == 0
+---