summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavan Deolasee2014-12-12 10:29:27 +0000
committerPavan Deolasee2015-04-15 05:46:41 +0000
commite7e6f4d4e1801aa8a34a06f7d62dba809222b4df (patch)
tree263db4920eee9687680043d7041d27aa4f906d76
parent1d7412d23298c222af099a786f4f974d92914746 (diff)
Revert "Do not read prototype config file when dealing with user specified conf file"
This reverts commit 9d95e395d43d4c9c91908cc67099ed3c9ebda960.
-rw-r--r--contrib/pgxc_ctl/bash_handler.c9
-rw-r--r--contrib/pgxc_ctl/bash_handler.h2
-rw-r--r--contrib/pgxc_ctl/pgxc_ctl.c4
3 files changed, 6 insertions, 9 deletions
diff --git a/contrib/pgxc_ctl/bash_handler.c b/contrib/pgxc_ctl/bash_handler.c
index c4aa1e27f1..1cae6b46b3 100644
--- a/contrib/pgxc_ctl/bash_handler.c
+++ b/contrib/pgxc_ctl/bash_handler.c
@@ -24,7 +24,7 @@ extern char *pgxc_ctl_conf_prototype[];
/*
* Install bash script.
*/
-void install_pgxc_ctl_bash(char *path, int read_prototype)
+void install_pgxc_ctl_bash(char *path)
{
char cmd[1024];
FILE *pgxc_ctl_bash = fopen(path, "w");
@@ -35,11 +35,8 @@ void install_pgxc_ctl_bash(char *path, int read_prototype)
{
elog(ERROR, "ERROR: Could not open pgxc_ctl bash script, %s, %s\n", path, strerror(errno));
}
- if (read_prototype)
- {
- for (i=0; pgxc_ctl_conf_prototype[i]; i++)
- fprintf(pgxc_ctl_bash, "%s\n", pgxc_ctl_conf_prototype[i]);
- }
+ for (i=0; pgxc_ctl_conf_prototype[i]; i++)
+ fprintf(pgxc_ctl_bash, "%s\n", pgxc_ctl_conf_prototype[i]);
for (i=0; pgxc_ctl_bash_script[i]; i++)
fprintf(pgxc_ctl_bash, "%s\n", pgxc_ctl_bash_script[i]);
fclose(pgxc_ctl_bash);
diff --git a/contrib/pgxc_ctl/bash_handler.h b/contrib/pgxc_ctl/bash_handler.h
index c0494137bd..c16638b7a3 100644
--- a/contrib/pgxc_ctl/bash_handler.h
+++ b/contrib/pgxc_ctl/bash_handler.h
@@ -11,7 +11,7 @@
#ifndef BASH_HANDLER_H
#define BASH_HANDLER_H
-void install_pgxc_ctl_bash(char *path, int read_prototype);
+void install_pgxc_ctl_bash(char *path);
void read_config_file(char *path, char *conf);
void uninstall_pgxc_ctl_bash(char *path);
diff --git a/contrib/pgxc_ctl/pgxc_ctl.c b/contrib/pgxc_ctl/pgxc_ctl.c
index 1bb567bcfa..4f47c656b0 100644
--- a/contrib/pgxc_ctl/pgxc_ctl.c
+++ b/contrib/pgxc_ctl/pgxc_ctl.c
@@ -241,7 +241,7 @@ static void read_configuration(void)
FILE *conf;
char cmd[MAXPATH+1];
- install_pgxc_ctl_bash(pgxc_ctl_bash_path, false);
+ install_pgxc_ctl_bash(pgxc_ctl_bash_path);
if (pgxc_ctl_config_path[0])
snprintf(cmd, MAXPATH, "%s --home %s --configuration %s",
pgxc_ctl_bash_path, pgxc_ctl_home, pgxc_ctl_config_path);
@@ -267,7 +267,7 @@ static void prepare_pgxc_ctl_bash(char *path)
rc = stat(path, &buf);
if (rc)
- install_pgxc_ctl_bash(path, true);
+ install_pgxc_ctl_bash(path);
else
if (S_ISREG(buf.st_mode))
return;