summaryrefslogtreecommitdiff
path: root/src/backend/storage/file/fd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/storage/file/fd.c')
-rw-r--r--src/backend/storage/file/fd.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index 4875b7f2bcf..df7d58d7940 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.105 2003/12/20 17:31:21 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/file/fd.c,v 1.106 2004/01/26 22:35:32 tgl Exp $
*
* NOTES:
*
@@ -397,7 +397,7 @@ LruDelete(File file)
/* close the file */
if (close(vfdP->fd))
- elog(LOG, "failed to close \"%s\": %m",
+ elog(ERROR, "failed to close \"%s\": %m",
vfdP->fileName);
--nfile;
@@ -842,7 +842,7 @@ FileClose(File file)
/* close the file */
if (close(vfdP->fd))
- elog(LOG, "failed to close \"%s\": %m",
+ elog(ERROR, "failed to close \"%s\": %m",
vfdP->fileName);
--nfile;
@@ -1069,7 +1069,13 @@ TryAgain:
return NULL;
}
-void
+/*
+ * Close a file returned by AllocateFile.
+ *
+ * Note we do not check fclose's return value --- it is up to the caller
+ * to handle close errors.
+ */
+int
FreeFile(FILE *file)
{
int i;
@@ -1089,7 +1095,7 @@ FreeFile(FILE *file)
if (i < 0)
elog(WARNING, "file passed to FreeFile was not obtained from AllocateFile");
- fclose(file);
+ return fclose(file);
}
/*