diff options
author | Bruce Momjian <bruce@momjian.us> | 1997-08-18 02:15:04 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1997-08-18 02:15:04 +0000 |
commit | 022903f22e54cbc78b4acc1ef54f73d19a051630 (patch) | |
tree | 2a2d88e2f97a71233a4b61c1ebf549e663f3d3aa /src/backend/tcop | |
parent | eaae21fb4d4b8423dbd26731d9fcd3b3cecf2724 (diff) | |
download | postgresql-022903f22e54cbc78b4acc1ef54f73d19a051630.tar.gz postgresql-022903f22e54cbc78b4acc1ef54f73d19a051630.zip |
Reduce open() calls. Replace fopen() calls with calls to fd.c functions.
Diffstat (limited to 'src/backend/tcop')
-rw-r--r-- | src/backend/tcop/utility.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index e71214c5c6e..f0721423560 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.18 1997/07/24 20:15:18 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.19 1997/08/18 02:14:52 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -47,6 +47,7 @@ #include "tcop/variable.h" #include "tcop/utility.h" #include "fmgr.h" /* For load_file() */ +#include "storage/fd.h" #ifndef NO_SECURITY #include "miscadmin.h" @@ -218,9 +219,6 @@ ProcessUtility(Node *parsetree, commandTag = "COPY"; CHECK_IF_ABORTED(); - /* Free up file descriptors - going to do a read... */ - closeOneVfd(); - DoCopy(stmt->relname, stmt->binary, stmt->oids, @@ -594,9 +592,9 @@ ProcessUtility(Node *parsetree, filename = stmt->filename; closeAllVfds(); - if ((fp = fopen(filename, "r")) == NULL) + if ((fp = AllocateFile(filename, "r")) == NULL) elog(WARN, "LOAD: could not open file %s", filename); - fclose(fp); + FreeFile(fp); load_file(filename); } break; |