mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
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.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user