diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 1999-10-25 03:08:03 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 1999-10-25 03:08:03 +0000 |
commit | 51f62d505e2aba66bf7870c7bd005cd32e7d0953 (patch) | |
tree | 127e7cbbf6679dbc2e3cfd08786ab88a7a801f50 /src/backend/utils/error/elog.c | |
parent | 8a17ed63359325c567694fdd378e71803a53cc73 (diff) | |
download | postgresql-51f62d505e2aba66bf7870c7bd005cd32e7d0953.tar.gz postgresql-51f62d505e2aba66bf7870c7bd005cd32e7d0953.zip |
Standardize on MAXPGPATH as the size of a file pathname buffer,
eliminating some wildly inconsistent coding in various parts of the
system. I set MAXPGPATH = 1024 in config.h.in. If anyone is really
convinced that there ought to be a configure-time test to set the
value, go right ahead ... but I think it's a waste of time.
Diffstat (limited to 'src/backend/utils/error/elog.c')
-rw-r--r-- | src/backend/utils/error/elog.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c index 342a1029d16..247cf1c724a 100644 --- a/src/backend/utils/error/elog.c +++ b/src/backend/utils/error/elog.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.49 1999/10/06 21:58:09 vadim Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.50 1999/10/25 03:07:50 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -415,7 +415,6 @@ DebugFileOpen(void) if (OutputFileName[0]) { - OutputFileName[MAXPGPATH - 1] = '\0'; if ((fd = open(OutputFileName, O_CREAT | O_APPEND | O_WRONLY, 0666)) < 0) elog(FATAL, "DebugFileOpen: open of %s: %m", @@ -448,7 +447,8 @@ DebugFileOpen(void) fd = fileno(stderr); if (fcntl(fd, F_GETFD, 0) < 0) { - sprintf(OutputFileName, "%s/pg.errors.%d", DataDir, (int) MyProcPid); + snprintf(OutputFileName, MAXPGPATH, "%s%cpg.errors.%d", + DataDir, SEP_CHAR, (int) MyProcPid); fd = open(OutputFileName, O_CREAT | O_APPEND | O_WRONLY, 0666); } if (fd < 0) |