aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-07-26 15:15:18 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-07-26 15:15:18 +0000
commite4f4a7f5a4b0956e77b15046a0b8c298a2d98497 (patch)
treee4bd911a5c5e66a2214c734b335acfa9c0962082 /src/backend
parent82eed4dba254b8fda71d429b29d222ffb4e93fca (diff)
downloadpostgresql-e4f4a7f5a4b0956e77b15046a0b8c298a2d98497.tar.gz
postgresql-e4f4a7f5a4b0956e77b15046a0b8c298a2d98497.zip
Remove FileUnlink(), which wasn't being used anywhere and interacted poorly
with the recent patch to log temp file sizes at removal time. Doesn't seem worth fixing since it's unused. In passing, make a few elog messages conform to the message style guide.
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/storage/file/fd.c35
1 files changed, 8 insertions, 27 deletions
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index f024c8e23fe..79da1f9c6fe 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
- * $PostgreSQL: pgsql/src/backend/storage/file/fd.c,v 1.139 2007/06/07 19:19:57 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/file/fd.c,v 1.140 2007/07/26 15:15:18 tgl Exp $
*
* NOTES:
*
@@ -549,8 +549,7 @@ LruDelete(File file)
/* close the file */
if (close(vfdP->fd))
- elog(ERROR, "failed to close \"%s\": %m",
- vfdP->fileName);
+ elog(ERROR, "could not close file \"%s\": %m", vfdP->fileName);
--nfile;
vfdP->fd = VFD_CLOSED;
@@ -985,8 +984,7 @@ FileClose(File file)
/* close the file */
if (close(vfdP->fd))
- elog(ERROR, "failed to close \"%s\": %m",
- vfdP->fileName);
+ elog(ERROR, "could not close file \"%s\": %m", vfdP->fileName);
--nfile;
vfdP->fd = VFD_CLOSED;
@@ -1005,15 +1003,15 @@ FileClose(File file)
{
if (filestats.st_size >= log_temp_files)
ereport(LOG,
- (errmsg("temp file: path \"%s\" size %lu",
- vfdP->fileName, (unsigned long)filestats.st_size)));
+ (errmsg("temp file: path \"%s\" size %lu",
+ vfdP->fileName,
+ (unsigned long) filestats.st_size)));
}
else
- elog(LOG, "Could not stat \"%s\": %m", vfdP->fileName);
+ elog(LOG, "could not stat file \"%s\": %m", vfdP->fileName);
}
if (unlink(vfdP->fileName))
- elog(LOG, "failed to unlink \"%s\": %m",
- vfdP->fileName);
+ elog(LOG, "could not unlink file \"%s\": %m", vfdP->fileName);
}
/*
@@ -1022,23 +1020,6 @@ FileClose(File file)
FreeVfd(file);
}
-/*
- * close a file and forcibly delete the underlying Unix file
- */
-void
-FileUnlink(File file)
-{
- Assert(FileIsValid(file));
-
- DO_DB(elog(LOG, "FileUnlink: %d (%s)",
- file, VfdCache[file].fileName));
-
- /* force FileClose to delete it */
- VfdCache[file].fdstate |= FD_TEMPORARY;
-
- FileClose(file);
-}
-
int
FileRead(File file, char *buffer, int amount)
{