Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc1d89c6

Browse files
author
Neil Conway
committed
Minor code cleanup: calling FreeFile() before ereport(ERROR) is not
necessary, since files opened via AllocateFile() are closed automaticallyas part of error recovery.
1 parent9cce91d commitc1d89c6

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

‎src/backend/commands/copy.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.284 2007/06/17 23:39:28 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.285 2007/06/20 02:02:49 neilc Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1223,12 +1223,9 @@ DoCopyTo(CopyState cstate)
12231223

12241224
fstat(fileno(cstate->copy_file),&st);
12251225
if (S_ISDIR(st.st_mode))
1226-
{
1227-
FreeFile(cstate->copy_file);
12281226
ereport(ERROR,
12291227
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
12301228
errmsg("\"%s\" is a directory",cstate->filename)));
1231-
}
12321229
}
12331230

12341231
PG_TRY();
@@ -1728,12 +1725,9 @@ CopyFrom(CopyState cstate)
17281725

17291726
fstat(fileno(cstate->copy_file),&st);
17301727
if (S_ISDIR(st.st_mode))
1731-
{
1732-
FreeFile(cstate->copy_file);
17331728
ereport(ERROR,
17341729
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
17351730
errmsg("\"%s\" is a directory",cstate->filename)));
1736-
}
17371731
}
17381732

17391733
tupDesc=RelationGetDescr(cstate->rel);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp