1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-29 10:41:53 +03:00

Replace direct fprintf(stderr) calls by write_stderr(), and cause this

routine to do something appropriate on Win32.  Also, add a security check
on Win32 that parallels the can't-run-as-root check on Unix.

Magnus Hagander
This commit is contained in:
Tom Lane
2004-06-24 21:03:42 +00:00
parent b5b9e33564
commit b15f9b08ef
13 changed files with 319 additions and 102 deletions

View File

@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.184 2004/06/06 00:41:26 tgl Exp $
* $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.185 2004/06/24 21:02:24 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -328,12 +328,11 @@ BootstrapMain(int argc, char *argv[])
{
if (!potential_DataDir)
{
fprintf(stderr,
gettext("%s does not know where to find the database system data.\n"
"You must specify the directory that contains the database system\n"
"either by specifying the -D invocation option or by setting the\n"
"PGDATA environment variable.\n"),
argv[0]);
write_stderr("%s does not know where to find the database system data.\n"
"You must specify the directory that contains the database system\n"
"either by specifying the -D invocation option or by setting the\n"
"PGDATA environment variable.\n",
argv[0]);
proc_exit(1);
}
SetDataDir(potential_DataDir);
@ -503,15 +502,14 @@ BootstrapMain(int argc, char *argv[])
static void
usage(void)
{
fprintf(stderr,
gettext("Usage:\n"
write_stderr("Usage:\n"
" postgres -boot [OPTION]... DBNAME\n"
" -c NAME=VALUE set run-time parameter\n"
" -d 1-5 debug level\n"
" -D datadir data directory\n"
" -F turn off fsync\n"
" -o file send debug output to file\n"
" -x num internal use\n"));
" -x num internal use\n");
proc_exit(1);
}