* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.99 2002/08/04 06:53:10 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.100 2002/08/05 01:24:13 thomas Exp $
*
*-------------------------------------------------------------------------
*/
/* File path names */
-static char XLogDir[MAXPGPATH] = "";
+char *XLogDir = NULL;
+
static char ControlFilePath[MAXPGPATH];
/*
void
SetXLogDir(char *path)
{
+ char *xsubdir = "/pg_xlog";
+
if (path != NULL)
{
- if (strlen(path) >= MAXPGPATH)
- elog(FATAL, "XLOG path '%s' is too long"
- "; maximum length is %d characters", path, MAXPGPATH-1);
+ XLogDir = malloc(strlen(path)+1);
strcpy(XLogDir, path);
}
else
{
- snprintf(XLogDir, MAXPGPATH, "%s/pg_xlog", DataDir);
+ XLogDir = malloc(strlen(DataDir)+strlen(xsubdir)+1);
+ snprintf(XLogDir, MAXPGPATH, "%s%s", DataDir, xsubdir);
}
}
XLOGPathInit(void)
{
/* Init XLOG file paths */
- if (strlen(XLogDir) <= 0)
+ if (XLogDir == NULL)
SetXLogDir(NULL);
snprintf(ControlFilePath, MAXPGPATH, "%s/global/pg_control", DataDir);
}
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: xlog.h,v 1.32 2002/08/04 06:26:38 thomas Exp $
+ * $Id: xlog.h,v 1.33 2002/08/05 01:24:16 thomas Exp $
*/
#ifndef XLOG_H
#define XLOG_H
} XLogRecData;
/* XLOG directory name */
-extern char XLogDir[];
+extern char *XLogDir;
extern StartUpID ThisStartUpID; /* current SUI */
extern bool InRecovery;