about summary refs log tree commit diff
path: root/Src/Modules
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2005-02-06 20:36:09 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2005-02-06 20:36:09 +0000
commit05b06b1c08263af07b2297aac0c842dafca39445 (patch)
treef64a8e7c40efd43221cfa4bd8f0391e0c993765d /Src/Modules
parent64c2db0ca242269c92fac5cc8637580364c2b6f6 (diff)
downloadzsh-05b06b1c08263af07b2297aac0c842dafca39445.tar.gz
zsh-05b06b1c08263af07b2297aac0c842dafca39445.tar.xz
zsh-05b06b1c08263af07b2297aac0c842dafca39445.zip
fix autoloaded trap bug; rejig use of trapfuncs
(now traplists); improve trap tests
Diffstat (limited to 'Src/Modules')
-rw-r--r--Src/Modules/parameter.c3
-rw-r--r--Src/Modules/zftp.c5
2 files changed, 4 insertions, 4 deletions
diff --git a/Src/Modules/parameter.c b/Src/Modules/parameter.c
index e4dab1e64..966b26e6f 100644
--- a/Src/Modules/parameter.c
+++ b/Src/Modules/parameter.c
@@ -332,13 +332,12 @@ setfunction(char *name, char *val, int dis)
 
     if (!strncmp(name, "TRAP", 4) &&
 	(sn = getsignum(name + 4)) != -1) {
-	if (settrap(sn, shf->funcdef)) {
+	if (settrap(sn, NULL, ZSIG_FUNC)) {
 	    freeeprog(shf->funcdef);
 	    zfree(shf, sizeof(*shf));
 	    zsfree(val);
 	    return;
 	}
-	sigtrapped[sn] |= ZSIG_FUNC;
     }
     shfunctab->addnode(shfunctab, ztrdup(name), shf);
     zsfree(val);
diff --git a/Src/Modules/zftp.c b/Src/Modules/zftp.c
index 399070939..f97cde46f 100644
--- a/Src/Modules/zftp.c
+++ b/Src/Modules/zftp.c
@@ -436,7 +436,8 @@ zfunalarm(void)
     } else
 	alarm(0);
     if (sigtrapped[SIGALRM] || interact) {
-	if (sigfuncs[SIGALRM] || !sigtrapped[SIGALRM])
+	if (siglists[SIGALRM] || !sigtrapped[SIGALRM] ||
+	    (sigtrapped[SIGALRM] & ZSIG_FUNC))
 	    install_handler(SIGALRM);
 	else
 	    signal_ignore(SIGALRM);
@@ -452,7 +453,7 @@ static void
 zfunpipe()
 {
     if (sigtrapped[SIGPIPE]) {
-	if (sigfuncs[SIGPIPE])
+	if (siglists[SIGPIPE] || (sigtrapped[SIGPIPE] & ZSIG_FUNC))
 	    install_handler(SIGPIPE);
 	else
 	    signal_ignore(SIGPIPE);