diff options
author | Thomas G. Lockhart <lockhart@fourpalms.org> | 2002-08-05 01:24:16 +0000 |
---|---|---|
committer | Thomas G. Lockhart <lockhart@fourpalms.org> | 2002-08-05 01:24:16 +0000 |
commit | ac1a3dcf24e182a1cc9a136246b7f18a8a64bbd5 (patch) | |
tree | 4e776754602fe672dc5a1d6f87158a7877ee851e /src/backend/access/transam/xlog.c | |
parent | 0fe931a3e0f259bd2933e48ee09bd3d7435149b4 (diff) | |
download | postgresql-ac1a3dcf24e182a1cc9a136246b7f18a8a64bbd5.tar.gz postgresql-ac1a3dcf24e182a1cc9a136246b7f18a8a64bbd5.zip |
Fix compilation problem with assert checking enabled for recent xlog
location feature.
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r-- | src/backend/access/transam/xlog.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index fa9cc90dd53..872722b856c 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -7,7 +7,7 @@ * 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 $ * *------------------------------------------------------------------------- */ @@ -389,7 +389,8 @@ static ControlFileData *ControlFile = NULL; /* File path names */ -static char XLogDir[MAXPGPATH] = ""; +char *XLogDir = NULL; + static char ControlFilePath[MAXPGPATH]; /* @@ -2068,16 +2069,17 @@ ValidXLOGHeader(XLogPageHeader hdr, int emode, bool checkSUI) 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); } } @@ -2085,7 +2087,7 @@ void XLOGPathInit(void) { /* Init XLOG file paths */ - if (strlen(XLogDir) <= 0) + if (XLogDir == NULL) SetXLogDir(NULL); snprintf(ControlFilePath, MAXPGPATH, "%s/global/pg_control", DataDir); } |