mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-25 05:10:28 +02:00
39870: ensure exit trap can always run
This commit is contained in:
parent
dfb2f3f3d2
commit
a57977d01a
3 changed files with 23 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue