aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/file/fd.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2001-05-25 15:45:34 +0000
committerBruce Momjian <bruce@momjian.us>2001-05-25 15:45:34 +0000
commitf6923ff3ac8320a82f4bb070b09e9b1fed3d91c9 (patch)
tree99937ac8a95d3ded1c263536c19de0e6bf05ec17 /src/backend/storage/file/fd.c
parentdffb673692f96a6cc52411762b8ba07201687313 (diff)
downloadpostgresql-f6923ff3ac8320a82f4bb070b09e9b1fed3d91c9.tar.gz
postgresql-f6923ff3ac8320a82f4bb070b09e9b1fed3d91c9.zip
Oops, only wanted python change in the last commit. Backing out.
Diffstat (limited to 'src/backend/storage/file/fd.c')
-rw-r--r--src/backend/storage/file/fd.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index 8816589787a..23c1ef8d808 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.77 2001/05/25 15:34:50 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.78 2001/05/25 15:45:33 momjian Exp $
*
* NOTES:
*
@@ -742,29 +742,21 @@ PathNameOpenFile(FileName fileName, int fileFlags, int fileMode)
File
OpenTemporaryFile(void)
{
- char tempfilepath[128];
+ char tempfilename[64];
File file;
/*
* Generate a tempfile name that's unique within the current
* transaction
*/
- snprintf(tempfilepath, sizeof(tempfilepath),
- "%s%c%d.%ld", SORT_TEMP_DIR, SEP_CHAR, MyProcPid,
- tempFileCounter++);
+ snprintf(tempfilename, sizeof(tempfilename),
+ "pg_sorttemp%d.%ld", MyProcPid, tempFileCounter++);
/* Open the file */
- file = FileNameOpenFile(tempfilepath,
+ file = FileNameOpenFile(tempfilename,
O_RDWR | O_CREAT | O_TRUNC | PG_BINARY, 0600);
if (file <= 0)
- {
- /* mkdir could fail if some one else already created it */
- mkdir(SORT_TEMP_DIR, S_IRWXU);
- file = FileNameOpenFile(tempfilepath,
- O_RDWR | O_CREAT | O_TRUNC | PG_BINARY, 0600);
- if (file <= 0)
- elog(ERROR, "Failed to create temporary file %s", tempfilepath);
- }
+ elog(ERROR, "Failed to create temporary file %s", tempfilename);
/* Mark it for deletion at close or EOXact */
VfdCache[file].fdstate |= FD_TEMPORARY;