Commit 995773be authored by Bruce Momjian's avatar Bruce Momjian

Pass canAcceptConnections to exec'ed backend, for Jan.

parent 5ecd4e3f
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.325 2003/05/08 20:43:07 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.326 2003/05/09 15:57:24 momjian Exp $
* *
* NOTES * NOTES
* *
...@@ -2431,7 +2431,7 @@ BackendFinalize(Port *port) ...@@ -2431,7 +2431,7 @@ BackendFinalize(Port *port)
#ifdef EXEC_BACKEND #ifdef EXEC_BACKEND
Assert(UsedShmemSegID != 0 && UsedShmemSegAddr != NULL); Assert(UsedShmemSegID != 0 && UsedShmemSegAddr != NULL);
/* database name at the end because it might contain commas */ /* database name at the end because it might contain commas */
snprintf(pbuf, NAMEDATALEN + 256, "%d,%d,%p,%s", port->sock, snprintf(pbuf, NAMEDATALEN + 256, "%d,%d,%d,%p,%s", port->sock, canAcceptConnections(),
UsedShmemSegID, UsedShmemSegAddr, port->database_name); UsedShmemSegID, UsedShmemSegAddr, port->database_name);
av[ac++] = pbuf; av[ac++] = pbuf;
#else #else
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.340 2003/05/08 18:16:36 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.341 2003/05/09 15:57:24 momjian Exp $
* *
* NOTES * NOTES
* this is the "main" module of the postgres backend and * this is the "main" module of the postgres backend and
...@@ -2142,16 +2142,15 @@ PostgresMain(int argc, char *argv[], const char *username) ...@@ -2142,16 +2142,15 @@ PostgresMain(int argc, char *argv[], const char *username)
{ {
#ifdef EXEC_BACKEND #ifdef EXEC_BACKEND
char *p; char *p;
int i;
sscanf(optarg, "%d,%d,%p,", &MyProcPort->sock, int PMcanAcceptConnections; /* will eventually be global or static, when fork */
sscanf(optarg, "%d,%d,%d,%p,", &MyProcPort->sock, &PMcanAcceptConnections,
&UsedShmemSegID, &UsedShmemSegAddr); &UsedShmemSegID, &UsedShmemSegAddr);
/* Grab dbname as last param */ /* Grab dbname as last param */
p = strchr(optarg, ','); for (i = 0, p = optarg-1; i < 4 && p; i++)
if (p)
p = strchr(p+1, ',');
if (p)
p = strchr(p+1, ','); p = strchr(p+1, ',');
if (p) if (i == 4 && p)
dbname = strdup(p+1); dbname = strdup(p+1);
#else #else
dbname = strdup(optarg); dbname = strdup(optarg);
...@@ -2512,7 +2511,7 @@ PostgresMain(int argc, char *argv[], const char *username) ...@@ -2512,7 +2511,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.340 $ $Date: 2003/05/08 18:16:36 $\n"); puts("$Revision: 1.341 $ $Date: 2003/05/09 15:57:24 $\n");
} }
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment