diff options
| -rw-r--r-- | contrib/pgxc_ctl/bash_handler.c | 9 | ||||
| -rw-r--r-- | contrib/pgxc_ctl/bash_handler.h | 2 | ||||
| -rw-r--r-- | contrib/pgxc_ctl/pgxc_ctl.c | 4 |
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; |
