summaryrefslogtreecommitdiff
path: root/src/bin/initdb
diff options
context:
space:
mode:
authorTom Lane2013-10-22 23:40:26 +0000
committerTom Lane2013-10-22 23:40:26 +0000
commit2c66f9924c1162bfba27c77004ccf42fb6ea188d (patch)
tree920c20776ef6d13d7a5d3a836202d897abcaf428 /src/bin/initdb
parent09a89cb5fc29b47c26d151e82293fd3bef592b7b (diff)
Replace pg_asprintf() with psprintf().
This eliminates an awkward coding pattern that's also unnecessarily inconsistent with backend coding. psprintf() is now the thing to use everywhere.
Diffstat (limited to 'src/bin/initdb')
-rw-r--r--src/bin/initdb/initdb.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index f7073e26bd..3983b23731 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -949,7 +949,7 @@ mkdatadir(const char *subdir)
char *path;
if (subdir)
- pg_asprintf(&path, "%s/%s", pg_data, subdir);
+ path = psprintf("%s/%s", pg_data, subdir);
else
path = pg_strdup(pg_data);
@@ -969,7 +969,7 @@ mkdatadir(const char *subdir)
static void
set_input(char **dest, char *filename)
{
- pg_asprintf(dest, "%s/%s", share_path, filename);
+ *dest = psprintf("%s/%s", share_path, filename);
}
/*
@@ -1023,9 +1023,9 @@ write_version_file(char *extrapath)
char *path;
if (extrapath == NULL)
- pg_asprintf(&path, "%s/PG_VERSION", pg_data);
+ path = psprintf("%s/PG_VERSION", pg_data);
else
- pg_asprintf(&path, "%s/%s/PG_VERSION", pg_data, extrapath);
+ path = psprintf("%s/%s/PG_VERSION", pg_data, extrapath);
if ((version_file = fopen(path, PG_BINARY_W)) == NULL)
{
@@ -1053,7 +1053,7 @@ set_null_conf(void)
FILE *conf_file;
char *path;
- pg_asprintf(&path, "%s/postgresql.conf", pg_data);
+ path = psprintf("%s/postgresql.conf", pg_data);
conf_file = fopen(path, PG_BINARY_W);
if (conf_file == NULL)
{
@@ -2951,7 +2951,7 @@ setup_pgdata(void)
* need quotes otherwise on Windows because paths there are most likely to
* have embedded spaces.
*/
- pg_asprintf(&pgdata_set_env, "PGDATA=%s", pg_data);
+ pgdata_set_env = psprintf("PGDATA=%s", pg_data);
putenv(pgdata_set_env);
}
@@ -3345,7 +3345,7 @@ create_xlog_symlink(void)
}
/* form name of the place where the symlink must go */
- pg_asprintf(&linkloc, "%s/pg_xlog", pg_data);
+ linkloc = psprintf("%s/pg_xlog", pg_data);
#ifdef HAVE_SYMLINK
if (symlink(xlog_dir, linkloc) != 0)