From a57977d01acc3b1b63aec1b79394ef7ffd052912 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 8 Nov 2016 13:02:24 +0000 Subject: 39870: ensure exit trap can always run --- Test/C03traps.ztst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'Test/C03traps.ztst') diff --git a/Test/C03traps.ztst b/Test/C03traps.ztst index 74b83f33a..828a3d10f 100644 --- a/Test/C03traps.ztst +++ b/Test/C03traps.ztst @@ -626,6 +626,21 @@ F:Must be tested with a top-level script rather than source or function >before-out >before-in + if zmodload zsh/system 2>/dev/null; then + ( + trap 'echo TERM; exit 2' TERM + trap 'echo EXIT' EXIT + kill -s TERM "$sysparams[pid]" + echo 'FATAL: we should never get here!' 1>&2 + exit 1 + ) + else + ZTST_skip="zsh/system library not found." + fi +2:EXIT trap from TERM trap +>TERM +>EXIT + %clean rm -f TRAPEXIT -- cgit 1.4.1