mirror of
https://github.com/postgres/postgres.git
synced 2025-11-13 16:22:44 +03:00
Remove SEP_CHAR, replace with / or '/' as appropriate.
This commit is contained in:
10
src/backend/utils/cache/relcache.c
vendored
10
src/backend/utils/cache/relcache.c
vendored
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.134 2001/05/14 22:06:41 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.135 2001/05/30 14:15:26 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2810,10 +2810,10 @@ write_irels(void)
|
||||
* another backend starting at about the same time might crash trying
|
||||
* to read the partially-complete file.
|
||||
*/
|
||||
snprintf(tempfilename, sizeof(tempfilename), "%s%c%s.%d",
|
||||
DatabasePath, SEP_CHAR, RELCACHE_INIT_FILENAME, MyProcPid);
|
||||
snprintf(finalfilename, sizeof(finalfilename), "%s%c%s",
|
||||
DatabasePath, SEP_CHAR, RELCACHE_INIT_FILENAME);
|
||||
snprintf(tempfilename, sizeof(tempfilename), "%s/%s.%d",
|
||||
DatabasePath, RELCACHE_INIT_FILENAME, MyProcPid);
|
||||
snprintf(finalfilename, sizeof(finalfilename), "%s/%s",
|
||||
DatabasePath, RELCACHE_INIT_FILENAME);
|
||||
|
||||
fd = PathNameOpenFile(tempfilename, O_WRONLY | O_CREAT | O_TRUNC | PG_BINARY, 0600);
|
||||
if (fd < 0)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.83 2001/03/22 03:59:58 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.84 2001/05/30 14:15:26 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -562,8 +562,8 @@ DebugFileOpen(void)
|
||||
fd = fileno(stderr);
|
||||
if (fcntl(fd, F_GETFD, 0) < 0)
|
||||
{
|
||||
snprintf(OutputFileName, MAXPGPATH, "%s%cpg.errors.%d",
|
||||
DataDir, SEP_CHAR, (int) MyProcPid);
|
||||
snprintf(OutputFileName, MAXPGPATH, "%s/pg.errors.%d",
|
||||
DataDir, (int) MyProcPid);
|
||||
fd = open(OutputFileName, O_CREAT | O_APPEND | O_WRONLY, 0666);
|
||||
}
|
||||
if (fd < 0)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.45 2001/03/22 06:16:19 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.46 2001/05/30 14:15:27 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -52,20 +52,19 @@ ExpandDatabasePath(const char *dbpath)
|
||||
return NULL; /* ain't gonna fit nohow */
|
||||
|
||||
/* leading path delimiter? then already absolute path */
|
||||
if (*dbpath == SEP_CHAR)
|
||||
if (*dbpath == '/')
|
||||
{
|
||||
#ifdef ALLOW_ABSOLUTE_DBPATHS
|
||||
cp = strrchr(dbpath, SEP_CHAR);
|
||||
cp = strrchr(dbpath, '/');
|
||||
len = cp - dbpath;
|
||||
strncpy(buf, dbpath, len);
|
||||
snprintf(&buf[len], MAXPGPATH - len, "%cbase%c%s",
|
||||
SEP_CHAR, SEP_CHAR, (cp + 1));
|
||||
snprintf(&buf[len], MAXPGPATH - len, "/base/%s", (cp + 1));
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
/* path delimiter somewhere? then has leading environment variable */
|
||||
else if ((cp = strchr(dbpath, SEP_CHAR)) != NULL)
|
||||
else if ((cp = strchr(dbpath, '/')) != NULL)
|
||||
{
|
||||
const char *envvar;
|
||||
|
||||
@@ -76,14 +75,12 @@ ExpandDatabasePath(const char *dbpath)
|
||||
if (envvar == NULL)
|
||||
return NULL;
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s%cbase%c%s",
|
||||
envvar, SEP_CHAR, SEP_CHAR, (cp + 1));
|
||||
snprintf(buf, sizeof(buf), "%s/base/%s", envvar, (cp + 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* no path delimiter? then add the default path prefix */
|
||||
snprintf(buf, sizeof(buf), "%s%cbase%c%s",
|
||||
DataDir, SEP_CHAR, SEP_CHAR, dbpath);
|
||||
snprintf(buf, sizeof(buf), "%s/base/%s", DataDir, dbpath);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user