1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +03:00

Restructure backend SIGINT/SIGTERM handling so that 'die' interrupts

are treated more like 'cancel' interrupts: the signal handler sets a
flag that is examined at well-defined spots, rather than trying to cope
with an interrupt that might happen anywhere.  See pghackers discussion
of 1/12/01.
This commit is contained in:
Tom Lane
2001-01-14 05:08:17 +00:00
parent 027f144e39
commit 36839c1927
24 changed files with 614 additions and 479 deletions

View File

@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.102 2000/12/28 13:00:12 vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.103 2001/01/14 05:08:15 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -329,9 +329,10 @@ BootstrapMain(int argc, char *argv[])
if (!IsUnderPostmaster)
{
pqsignal(SIGINT, (pqsigfunc) die);
pqsignal(SIGHUP, (pqsigfunc) die);
pqsignal(SIGTERM, (pqsigfunc) die);
pqsignal(SIGHUP, die);
pqsignal(SIGINT, die);
pqsignal(SIGTERM, die);
pqsignal(SIGQUIT, die);
}
/*
@ -383,8 +384,6 @@ BootstrapMain(int argc, char *argv[])
* abort processing resumes here
* ----------------
*/
pqsignal(SIGHUP, handle_warn);
if (sigsetjmp(Warn_restart, 1) != 0)
{
Warnings++;