1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-12 05:01:15 +03:00

Remove GetDatabaseName/Path and use globals. Make consts later.

This commit is contained in:
Bruce Momjian
1998-04-05 21:04:50 +00:00
parent 9e45687df5
commit 4b6fcc4459
6 changed files with 16 additions and 40 deletions

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.13 1998/04/05 05:51:58 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.14 1998/04/05 21:04:36 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -47,9 +47,7 @@
extern char *getenv(const char *name); /* XXX STDLIB */
/* from globals.c */
extern char *DatabaseName;
extern char *UserName;
extern char *DatabasePath;
#ifdef CYR_RECODE
unsigned char RecodeForwTable[128];
@@ -224,27 +222,6 @@ GetProcessingMode()
* ----------------------------------------------------------------
*/
/*
* GetDatabasePath --
* Returns path to database.
*
*/
const char *
GetDatabasePath()
{
return DatabasePath;
}
/*
* GetDatabaseName --
* Returns name of database.
*/
const char *
GetDatabaseName()
{
return DatabaseName;
}
void
SetDatabasePath(char *path)
{

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.26 1998/04/05 05:52:00 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.27 1998/04/05 21:04:43 momjian Exp $
*
* NOTES
* InitPostgres() is the function called from PostgresMain
@@ -126,7 +126,7 @@ InitMyDatabaseInfo(char *name)
if (!OidIsValid(MyDatabaseId))
elog(FATAL,
"Database %s does not exist in %s",
GetDatabaseName(),
DatabaseName,
DatabaseRelationName);
path = ExpandDatabasePath(myPath);
@@ -203,8 +203,8 @@ VerifyMyDatabase()
int fd;
char errormsg[1000];
name = GetDatabaseName();
myPath = GetDatabasePath();
name = DatabaseName;
myPath = DatabasePath;
if ((fd = open(myPath, O_RDONLY, 0)) == -1)
sprintf(errormsg,