mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-11-01 18:30:55 +01:00
fix autoloaded trap bug; rejig use of trapfuncs
(now traplists); improve trap tests
This commit is contained in:
parent
64c2db0ca2
commit
05b06b1c08
9 changed files with 129 additions and 41 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue