diff options
Diffstat (limited to 'src/backend/storage/file/fd.c')
-rw-r--r-- | src/backend/storage/file/fd.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c index c6a72b8f25d..137dd769e3f 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 - * $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.73 2001/02/18 04:39:42 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.74 2001/03/22 03:59:45 momjian Exp $ * * NOTES: * @@ -243,7 +243,7 @@ pg_fdatasync(int fd) int BasicOpenFile(FileName fileName, int fileFlags, int fileMode) { - int fd; + int fd; tryAgain: fd = open(fileName, fileFlags, fileMode); @@ -253,7 +253,7 @@ tryAgain: if (errno == EMFILE || errno == ENFILE) { - int save_errno = errno; + int save_errno = errno; DO_DB(elog(DEBUG, "BasicOpenFile: not enough descs, retry, er= %d", errno)); @@ -414,7 +414,7 @@ LruInsert(File file) { while (nfile + numAllocatedFiles >= pg_nofile()) { - if (! ReleaseLruFile()) + if (!ReleaseLruFile()) break; } @@ -460,6 +460,7 @@ ReleaseLruFile(void) if (nfile > 0) { + /* * There are opened files and so there should be at least one used * vfd in the ring. @@ -660,7 +661,7 @@ fileNameOpenFile(FileName fileName, while (nfile + numAllocatedFiles >= pg_nofile()) { - if (! ReleaseLruFile()) + if (!ReleaseLruFile()) break; } @@ -683,9 +684,10 @@ fileNameOpenFile(FileName fileName, vfdP->fileFlags = fileFlags & ~(O_TRUNC | O_EXCL); vfdP->fileMode = fileMode; vfdP->seekPos = 0; + /* - * Have to fsync file on commit. Alternative way - log - * file creation and fsync log before actual file creation. + * Have to fsync file on commit. Alternative way - log file creation + * and fsync log before actual file creation. */ if (fileFlags & O_CREAT) vfdP->fdstate = FD_DIRTY; @@ -1083,7 +1085,7 @@ TryAgain: if (errno == EMFILE || errno == ENFILE) { - int save_errno = errno; + int save_errno = errno; DO_DB(elog(DEBUG, "AllocateFile: not enough descs, retry, er= %d", errno)); |