only deal with signals that are not ignored

This commit is contained in:
ceriel 1990-08-29 11:44:33 +00:00
parent bee5d97eac
commit 1cb247fa39

View file

@ -50,6 +50,7 @@ sigtrp(trapno, signo)
*/ */
extern int errno; extern int errno;
int (*ctch)() = __ctchsig; int (*ctch)() = __ctchsig;
int (*oldctch)();
int oldtrap; int oldtrap;
if (signo <= 0 || signo >= sizeof(__traps)/sizeof(__traps[0])) { if (signo <= 0 || signo >= sizeof(__traps)/sizeof(__traps[0])) {
@ -70,10 +71,13 @@ sigtrp(trapno, signo)
oldtrap = __traps[signo]; oldtrap = __traps[signo];
if (signal(signo, ctch) == (int (*)())-1) /* errno set by signal */ if ((oldctch = signal(signo, ctch)) == (int (*)())-1) /* errno set by signal */
return -1; return -1;
__traps[signo] = trapno; else if (oldctch == SIG_IGN) {
signal(signo, SIG_IGN);
}
else __traps[signo] = trapno;
return oldtrap; return oldtrap;
} }