about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorPeter Stephenson <p.stephenson@samsung.com>2021-08-26 09:46:39 +0100
committerPeter Stephenson <p.stephenson@samsung.com>2021-08-26 09:46:39 +0100
commit0a80579ed18b4004a99b5dc062ce874c0bdc3201 (patch)
treecb10342377e88c80e7f6dae58d1945f49be6501b /Src/exec.c
parent4a9437317fd374e983934d5b18c7d1d6ee041645 (diff)
downloadzsh-0a80579ed18b4004a99b5dc062ce874c0bdc3201.tar.gz
zsh-0a80579ed18b4004a99b5dc062ce874c0bdc3201.tar.xz
zsh-0a80579ed18b4004a99b5dc062ce874c0bdc3201.zip
49307 with doc update: POSIX_TRAPS fix.
With POSIX_TRAPS set, an ignored signal stays ignored when entering
a subshell.
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/exec.c b/Src/exec.c
index 49ff88b80..79d8064b6 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1033,7 +1033,8 @@ entersubsh(int flags, struct entersubsh_ret *retp)
 
     if (!(flags & ESUB_KEEPTRAP))
 	for (sig = 0; sig < SIGCOUNT; sig++)
-	    if (!(sigtrapped[sig] & ZSIG_FUNC))
+	    if (!(sigtrapped[sig] & ZSIG_FUNC) &&
+		!(isset(POSIXTRAPS) && (sigtrapped[sig] & ZSIG_IGNORED)))
 		unsettrap(sig);
     monitor = isset(MONITOR);
     job_control_ok = monitor && (flags & ESUB_JOB_CONTROL) && isset(POSIXJOBS);