mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
Clean up some confusion about where and how to set whereToSendOutput.
We will no longer try to send elog messages to the client before we have initialized backend libpq (oops); however, reporting bogus commandline switches via elog does work now (not irrelevant, because of PGOPTIONS). Fix problem with inappropriate sending of checkpoint-process messages to stderr.
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.240 2001/09/07 16:12:48 wieck Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.241 2001/09/08 01:10:20 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
*
|
||||
@@ -687,6 +687,15 @@ PostmasterMain(int argc, char *argv[])
|
||||
pqsignal(SIGTTIN, SIG_IGN); /* ignored */
|
||||
pqsignal(SIGTTOU, SIG_IGN); /* ignored */
|
||||
|
||||
/*
|
||||
* Reset whereToSendOutput from Debug (its starting state) to None.
|
||||
* This prevents elog from sending messages to stderr unless the
|
||||
* syslog/stderr switch permits. We don't do this until the postmaster
|
||||
* is fully launched, since startup failures may as well be reported
|
||||
* to stderr.
|
||||
*/
|
||||
whereToSendOutput = None;
|
||||
|
||||
/*
|
||||
* Initialize and startup the statistics collector process
|
||||
*/
|
||||
@@ -1932,8 +1941,6 @@ DoBackend(Port *port)
|
||||
/* Reset MyProcPid to new backend's pid */
|
||||
MyProcPid = getpid();
|
||||
|
||||
whereToSendOutput = Remote; /* XXX probably doesn't belong here */
|
||||
|
||||
/*
|
||||
* We arrange for a simple exit(0) if we receive SIGTERM or SIGQUIT
|
||||
* during any client authentication related communication. Otherwise
|
||||
@@ -1955,6 +1962,10 @@ DoBackend(Port *port)
|
||||
|
||||
ClientAuthentication(MyProcPort); /* might not return, if failure */
|
||||
|
||||
/*
|
||||
* Done with authentication. Prevent SIGTERM/SIGQUIT again until
|
||||
* backend startup is complete.
|
||||
*/
|
||||
PG_SETMASK(&BlockSig);
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user