Cleanup patch for exec() handling.

This commit is contained in:
Bruce Momjian 2003-05-03 05:13:20 +00:00
parent a7fd03e1de
commit 721996d889
3 changed files with 14 additions and 12 deletions

View File

@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.151 2003/05/03 03:52:07 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.152 2003/05/03 05:13:18 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -236,7 +236,7 @@ BootstrapMain(int argc, char *argv[])
* *
* If we are running under the postmaster, this is done already. * If we are running under the postmaster, this is done already.
*/ */
if (!IsUnderPostmaster) if (!IsUnderPostmaster || ExecBackend)
MemoryContextInit(); MemoryContextInit();
/* /*
@ -245,9 +245,12 @@ BootstrapMain(int argc, char *argv[])
/* Set defaults, to be overriden by explicit options below */ /* Set defaults, to be overriden by explicit options below */
dbName = NULL; dbName = NULL;
if (!IsUnderPostmaster) if (!IsUnderPostmaster || ExecBackend)
{ {
InitializeGUCOptions(); InitializeGUCOptions();
#ifdef EXEC_BACKEND
read_nondefault_variables();
#endif
potential_DataDir = getenv("PGDATA"); /* Null if no PGDATA potential_DataDir = getenv("PGDATA"); /* Null if no PGDATA
* variable */ * variable */
} }
@ -306,7 +309,7 @@ BootstrapMain(int argc, char *argv[])
AttachSharedMemoryAndSemaphores(); AttachSharedMemoryAndSemaphores();
} }
if (!IsUnderPostmaster) if (!IsUnderPostmaster || ExecBackend)
{ {
if (!potential_DataDir) if (!potential_DataDir)
{ {

View File

@ -37,7 +37,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.320 2003/05/03 03:52:07 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.321 2003/05/03 05:13:18 momjian Exp $
* *
* NOTES * NOTES
* *
@ -2243,10 +2243,6 @@ BackendFinalize(Port *port)
/* Reset MyProcPid to new backend's pid */ /* Reset MyProcPid to new backend's pid */
MyProcPid = getpid(); MyProcPid = getpid();
#ifdef EXEC_BACKEND
read_nondefault_variables();
#endif
/* /*
* Initialize libpq and enable reporting of elog errors to the client. * Initialize libpq and enable reporting of elog errors to the client.
* Must do this now because authentication uses libpq to send * Must do this now because authentication uses libpq to send

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.330 2003/05/03 03:52:07 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.331 2003/05/03 05:13:20 momjian Exp $
* *
* NOTES * NOTES
* this is the "main" module of the postgres backend and * this is the "main" module of the postgres backend and
@ -1139,9 +1139,12 @@ PostgresMain(int argc, char *argv[], const char *username)
Noversion = false; Noversion = false;
EchoQuery = false; EchoQuery = false;
if (!IsUnderPostmaster) if (!IsUnderPostmaster || ExecBackend)
{ {
InitializeGUCOptions(); InitializeGUCOptions();
#ifdef EXEC_BACKEND
read_nondefault_variables();
#endif
potential_DataDir = getenv("PGDATA"); potential_DataDir = getenv("PGDATA");
} }
@ -1676,7 +1679,7 @@ PostgresMain(int argc, char *argv[], const char *username)
if (!IsUnderPostmaster) if (!IsUnderPostmaster)
{ {
puts("\nPOSTGRES backend interactive interface "); puts("\nPOSTGRES backend interactive interface ");
puts("$Revision: 1.330 $ $Date: 2003/05/03 03:52:07 $\n"); puts("$Revision: 1.331 $ $Date: 2003/05/03 05:13:20 $\n");
} }
/* /*