summaryrefslogtreecommitdiff
path: root/src/backend/access/transam/slru.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-07-04 04:51:52 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-07-04 04:51:52 +0000
commiteb5949d190e80360386113fde0f05854f0c9824d (patch)
treef5683b4ff77c0b311ae975817b88c5ccc65ce5a9 /src/backend/access/transam/slru.c
parent7504f0bae853b0b9fec03c8e361c8b1a4b1c3209 (diff)
Arrange for the postmaster (and standalone backends, initdb, etc) to
chdir into PGDATA and subsequently use relative paths instead of absolute paths to access all files under PGDATA. This seems to give a small performance improvement, and it should make the system more robust against naive DBAs doing things like moving a database directory that has a live postmaster in it. Per recent discussion.
Diffstat (limited to 'src/backend/access/transam/slru.c')
-rw-r--r--src/backend/access/transam/slru.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/access/transam/slru.c b/src/backend/access/transam/slru.c
index 24f9a947792..c7c12470209 100644
--- a/src/backend/access/transam/slru.c
+++ b/src/backend/access/transam/slru.c
@@ -48,7 +48,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/access/transam/slru.c,v 1.25 2005/06/19 21:34:01 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/slru.c,v 1.26 2005/07/04 04:51:44 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -190,7 +190,7 @@ SimpleLruInit(SlruCtl ctl, const char *name,
*/
ctl->shared = shared;
ctl->do_fsync = true; /* default behavior */
- snprintf(ctl->Dir, MAXPGPATH, "%s/%s", DataDir, subdir);
+ StrNCpy(ctl->Dir, subdir, sizeof(ctl->Dir));
}
/*