* This is a C implementation of the previous shell script for setting up a
* PostgreSQL cluster location, and should be highly compatible with it.
*
- * $Header: /cvsroot/pgsql/src/bin/initdb/initdb.c,v 1.5 2003/11/13 15:01:40 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/initdb/initdb.c,v 1.6 2003/11/13 20:12:47 momjian Exp $
*
* TODO:
* - clean up find_postgres code and return values
#ifdef WIN32
static char *expanded_path(char *);
+
#else
#define expanded_path(x) (x)
#endif
#ifndef WIN32
/* doesn't handle .* files */
snprintf(buf, sizeof(buf), "rm -rf '%s%s'", path,
- rmtopdir ? "" : "/*");
+ rmtopdir ? "" : "/*");
#else
snprintf(buf, sizeof(buf), "%s /s /q \"%s\"",
- rmtopdir ? "rmdir" : "del", path);
+ rmtopdir ? "rmdir" : "del", path);
#endif
return !system(buf);
return FIND_NOT_REGFILE;
#ifndef WIN32
+
/*
* Only unix requires this test, on WIN32 an .exe file should be
* executable
canonicalize_path(abspath);
return xstrdup(abspath);
}
-#endif
+#endif
/*
* set the paths pointing to postgres
for (i = 0; i < len; i++)
{
snprintf(cmd, sizeof(cmd), format, pgpath, bufs[i], n_connections,
- DEVNULL, DEVNULL);
+ DEVNULL, DEVNULL);
status = system(cmd);
if (status == 0)
break;
PG_CMD_OPEN;
if (fprintf(pg,
- "ALTER USER \"%s\" WITH PASSWORD '%s';\n", username, pwd1) < 0)
+ "ALTER USER \"%s\" WITH PASSWORD '%s';\n", username, pwd1) < 0)
{
/* write failure */
exit_nicely();
check_input(system_views_file);
printf("The files belonging to this database system will be owned "
- "by user \"%s\".\n"
- "This user must also own the server process.\n\n",
- effective_user);
+ "by user \"%s\".\n"
+ "This user must also own the server process.\n\n",
+ effective_user);
setlocales();
" %s%s%s/postmaster -D %s%s%s\n"
"or\n"
" %s%s%s/pg_ctl -D %s%s%s -l logfile start\n\n",
- QUOTE_PATH, pgpath, QUOTE_PATH, QUOTE_PATH, pg_data, QUOTE_PATH,
- QUOTE_PATH, pgpath, QUOTE_PATH, QUOTE_PATH, pg_data, QUOTE_PATH);
+ QUOTE_PATH, pgpath, QUOTE_PATH, QUOTE_PATH, pg_data, QUOTE_PATH,
+ QUOTE_PATH, pgpath, QUOTE_PATH, QUOTE_PATH, pg_data, QUOTE_PATH);
return 0;
}