mirror of
https://github.com/postgres/postgres.git
synced 2025-05-05 09:19:17 +03:00
Fix 'pg_ctl reload' to properly preserve postmaster commend-line
arguments on restart. Patch to releases 8.0 - 8.3.X.
This commit is contained in:
parent
b5ea5e2f1c
commit
feeac41bc6
@ -37,7 +37,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.505.2.5 2007/08/02 23:17:20 adunstan Exp $
|
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.505.2.6 2008/06/27 01:53:20 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
*
|
*
|
||||||
@ -3762,7 +3762,7 @@ CreateOptsFile(int argc, char *argv[], char *fullprogname)
|
|||||||
|
|
||||||
fprintf(fp, "%s", fullprogname);
|
fprintf(fp, "%s", fullprogname);
|
||||||
for (i = 1; i < argc; i++)
|
for (i = 1; i < argc; i++)
|
||||||
fprintf(fp, " %s%s%s", SYSTEMQUOTE, argv[i], SYSTEMQUOTE);
|
fprintf(fp, " \"%s\"", argv[i]);
|
||||||
fputs("\n", fp);
|
fputs("\n", fp);
|
||||||
|
|
||||||
if (fclose(fp))
|
if (fclose(fp))
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.74.2.4 2008/02/29 23:31:57 adunstan Exp $
|
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.74.2.5 2008/06/27 01:53:20 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -578,15 +578,18 @@ read_post_opts(void)
|
|||||||
{
|
{
|
||||||
char *arg1;
|
char *arg1;
|
||||||
|
|
||||||
arg1 = strchr(optline, *SYSTEMQUOTE);
|
/*
|
||||||
if (arg1 == NULL || arg1 == optline)
|
* Are we at the first option, as defined by space and
|
||||||
post_opts = "";
|
* double-quote?
|
||||||
else
|
*/
|
||||||
|
if ((arg1 = strstr(optline, " \"")) != NULL ||
|
||||||
|
/* check in case this is an older server */
|
||||||
|
(arg1 = strstr(optline, " -")) != NULL)
|
||||||
{
|
{
|
||||||
*(arg1 - 1) = '\0'; /* this should be a space */
|
*arg1 = '\0'; /* terminate so we get only program name */
|
||||||
post_opts = arg1;
|
post_opts = arg1 + 1; /* point past whitespace */
|
||||||
}
|
}
|
||||||
if (postgres_path != NULL)
|
if (postgres_path == NULL)
|
||||||
postgres_path = optline;
|
postgres_path = optline;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user