Don't call exit(3) from a signal handler.

Obtained from:	OpenBSD
This commit is contained in:
Dima Dorfman 2001-06-24 01:55:17 +00:00
parent 9e28aca5d2
commit e0e97f0aab
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=78688
2 changed files with 3 additions and 4 deletions

View File

@ -104,6 +104,5 @@ terminate(sig)
int sig;
{
/* XXX exit() shouldn't call exit() from a signal handler. */
exit(sig == 0 ? 0 : 1);
_exit(sig == 0 ? 0 : 1);
}

View File

@ -1400,7 +1400,7 @@ handle_hup(signo)
strcat(hup, "ed.hup");
write_file(hup, "w", 1, addr_last);
}
quit(2);
_exit(2);
}
@ -1409,7 +1409,7 @@ handle_int(signo)
int signo;
{
if (!sigactive)
quit(1);
_exit(1);
sigflags &= ~(1 << (signo - 1));
#ifdef _POSIX_SOURCE
siglongjmp(env, -1);