diff options
author | Bruce Momjian <bruce@momjian.us> | 2008-06-27 01:53:20 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2008-06-27 01:53:20 +0000 |
commit | feeac41bc6d63b5929af82d4ebbb7c10f3648ac0 (patch) | |
tree | 16b5aac476b2f7f544d7bb268085a52bd5ce01c0 /src/bin/pg_ctl/pg_ctl.c | |
parent | b5ea5e2f1c5dbd6a1618e8dfbfc642e85944c1da (diff) |
Fix 'pg_ctl reload' to properly preserve postmaster commend-line
arguments on restart. Patch to releases 8.0 - 8.3.X.
Diffstat (limited to 'src/bin/pg_ctl/pg_ctl.c')
-rw-r--r-- | src/bin/pg_ctl/pg_ctl.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c index 4ce60e7cda8..ebcbbc7094b 100644 --- a/src/bin/pg_ctl/pg_ctl.c +++ b/src/bin/pg_ctl/pg_ctl.c @@ -4,7 +4,7 @@ * * 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; - arg1 = strchr(optline, *SYSTEMQUOTE); - if (arg1 == NULL || arg1 == optline) - post_opts = ""; - else + /* + * Are we at the first option, as defined by space and + * double-quote? + */ + 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 */ - post_opts = arg1; + *arg1 = '\0'; /* terminate so we get only program name */ + post_opts = arg1 + 1; /* point past whitespace */ } - if (postgres_path != NULL) + if (postgres_path == NULL) postgres_path = optline; } else |