aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Conway <neilc@samurai.com>2007-06-20 02:02:49 +0000
committerNeil Conway <neilc@samurai.com>2007-06-20 02:02:49 +0000
commitc1d89c61fce88ee0e33910af8b0c628a162300c9 (patch)
tree0a58c1eaf2178e5f42f011ff7dc59f19b765fcb9
parent9cce91dba0de4f00b98f7e12535cc0efd33c69a8 (diff)
downloadpostgresql-c1d89c61fce88ee0e33910af8b0c628a162300c9.tar.gz
postgresql-c1d89c61fce88ee0e33910af8b0c628a162300c9.zip
Minor code cleanup: calling FreeFile() before ereport(ERROR) is not
necessary, since files opened via AllocateFile() are closed automatically as part of error recovery.
-rw-r--r--src/backend/commands/copy.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c
index 493d2944f1a..9bc1c388ee7 100644
--- a/src/backend/commands/copy.c
+++ b/src/backend/commands/copy.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.284 2007/06/17 23:39:28 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.285 2007/06/20 02:02:49 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1223,12 +1223,9 @@ DoCopyTo(CopyState cstate)
fstat(fileno(cstate->copy_file), &st);
if (S_ISDIR(st.st_mode))
- {
- FreeFile(cstate->copy_file);
ereport(ERROR,
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
errmsg("\"%s\" is a directory", cstate->filename)));
- }
}
PG_TRY();
@@ -1728,12 +1725,9 @@ CopyFrom(CopyState cstate)
fstat(fileno(cstate->copy_file), &st);
if (S_ISDIR(st.st_mode))
- {
- FreeFile(cstate->copy_file);
ereport(ERROR,
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
errmsg("\"%s\" is a directory", cstate->filename)));
- }
}
tupDesc = RelationGetDescr(cstate->rel);