summaryrefslogtreecommitdiff
path: root/regress/bin/ksh
diff options
context:
space:
mode:
Diffstat (limited to 'regress/bin/ksh')
-rw-r--r--regress/bin/ksh/trap.t24
1 files changed, 23 insertions, 1 deletions
diff --git a/regress/bin/ksh/trap.t b/regress/bin/ksh/trap.t
index 35c982da657..c4a4a90a701 100644
--- a/regress/bin/ksh/trap.t
+++ b/regress/bin/ksh/trap.t
@@ -1,4 +1,4 @@
-# $OpenBSD: trap.t,v 1.5 2022/10/16 10:19:02 kn Exp $
+# $OpenBSD: trap.t,v 1.6 2022/10/16 10:44:06 kn Exp $
#
# Check that I/O redirection failure triggers the ERR trap.
@@ -122,3 +122,25 @@ expected-stdout:
EXIT
expected-exit: e == 0
---
+
+
+name: failed-INTR-runs-EXIT
+description:
+ Check that EXIT runs under errexit even if interrupt handling failed.
+ SIGINT, SIGQUIT, SIGTERM and SIGHUP are handled specially.
+ XXX Find/explain the difference if the busy loop runs directly, i.e. not
+ inside a subshell or process ($PROG -c "...").
+# XXX should always be passed like PROG
+arguments: !-e!
+env-setup: !ARGS=-e!
+stdin:
+ exec timeout --preserve-status -s INT -- 0.1s $PROG $ARGS -c '
+ trap "echo EXIT" EXIT
+ trap "echo INT ; false" INT
+ (while : ; do : ; done)
+ '
+expected-stdout:
+ INT
+ EXIT
+expected-exit: e != 0
+---