mirror of
https://github.com/postgres/postgres.git
synced 2025-04-27 22:56:53 +03:00
Fix pg_ctl crash on "unregister" when a data directory is not specified.
by Magnus Hagander
This commit is contained in:
parent
34f8ee9737
commit
7930e627d8
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.63 2006/01/05 03:01:37 momjian Exp $
|
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.64 2006/01/14 15:41:28 petere Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -1519,10 +1519,13 @@ main(int argc, char **argv)
|
|||||||
do_wait = false;
|
do_wait = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pg_data)
|
||||||
|
{
|
||||||
snprintf(def_postopts_file, MAXPGPATH, "%s/postmaster.opts.default", pg_data);
|
snprintf(def_postopts_file, MAXPGPATH, "%s/postmaster.opts.default", pg_data);
|
||||||
snprintf(postopts_file, MAXPGPATH, "%s/postmaster.opts", pg_data);
|
snprintf(postopts_file, MAXPGPATH, "%s/postmaster.opts", pg_data);
|
||||||
snprintf(pid_file, MAXPGPATH, "%s/postmaster.pid", pg_data);
|
snprintf(pid_file, MAXPGPATH, "%s/postmaster.pid", pg_data);
|
||||||
snprintf(conf_file, MAXPGPATH, "%s/postgresql.conf", pg_data);
|
snprintf(conf_file, MAXPGPATH, "%s/postgresql.conf", pg_data);
|
||||||
|
}
|
||||||
|
|
||||||
switch (ctl_command)
|
switch (ctl_command)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user