Don't call exit(3) from a signal handler.
Obtained from: OpenBSD
This commit is contained in:
parent
945fa79a4a
commit
7438ee8a47
@ -104,6 +104,5 @@ terminate(sig)
|
|||||||
int sig;
|
int sig;
|
||||||
{
|
{
|
||||||
|
|
||||||
/* XXX exit() shouldn't call exit() from a signal handler. */
|
_exit(sig == 0 ? 0 : 1);
|
||||||
exit(sig == 0 ? 0 : 1);
|
|
||||||
}
|
}
|
||||||
|
@ -1400,7 +1400,7 @@ handle_hup(signo)
|
|||||||
strcat(hup, "ed.hup");
|
strcat(hup, "ed.hup");
|
||||||
write_file(hup, "w", 1, addr_last);
|
write_file(hup, "w", 1, addr_last);
|
||||||
}
|
}
|
||||||
quit(2);
|
_exit(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1409,7 +1409,7 @@ handle_int(signo)
|
|||||||
int signo;
|
int signo;
|
||||||
{
|
{
|
||||||
if (!sigactive)
|
if (!sigactive)
|
||||||
quit(1);
|
_exit(1);
|
||||||
sigflags &= ~(1 << (signo - 1));
|
sigflags &= ~(1 << (signo - 1));
|
||||||
#ifdef _POSIX_SOURCE
|
#ifdef _POSIX_SOURCE
|
||||||
siglongjmp(env, -1);
|
siglongjmp(env, -1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user