aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVadim B. Mikheev <vadim4o@yahoo.com>1997-05-06 02:03:20 +0000
committerVadim B. Mikheev <vadim4o@yahoo.com>1997-05-06 02:03:20 +0000
commit13f41aa90b382a43f3e4b10562a2860535e41db5 (patch)
treecebefcdfba4f3255dde9a1fa1937713b46e6dd65 /src
parentb45128f1c394808bca6c4ca345036f6b72a9b61a (diff)
downloadpostgresql-13f41aa90b382a43f3e4b10562a2860535e41db5.tar.gz
postgresql-13f41aa90b382a43f3e4b10562a2860535e41db5.zip
mdcreate():
fd = FileNameOpenFile(path, O_RDWR|O_CREAT|O_EXCL, 0600); /* * If the file already exists and is empty, we pretend that the * create succeeded. During bootstrap processing, we skip that check, * because pg_time, pg_variable, and pg_log get created before their * .bki file entries are processed. * > * As the result of this pretence it was possible to have in > * pg_class > 1 records with the same relname. Actually, it > * should be fixed in upper levels, too, but... - vadim 05/06/97 > */
Diffstat (limited to 'src')
-rw-r--r--src/backend/storage/smgr/md.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c
index fdcefb78ad6..81a46c7fedf 100644
--- a/src/backend/storage/smgr/md.c
+++ b/src/backend/storage/smgr/md.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.11 1997/02/14 04:17:08 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.12 1997/05/06 02:03:20 vadim Exp $
*
*-------------------------------------------------------------------------
*/
@@ -99,7 +99,6 @@ int
mdcreate(Relation reln)
{
int fd, vfd;
- int tmp;
char *path;
extern bool IsBootstrapProcessingMode();
@@ -111,16 +110,19 @@ mdcreate(Relation reln)
* create succeeded. During bootstrap processing, we skip that check,
* because pg_time, pg_variable, and pg_log get created before their
* .bki file entries are processed.
+ *
+ * As the result of this pretence it was possible to have in
+ * pg_class > 1 records with the same relname. Actually, it
+ * should be fixed in upper levels, too, but... - vadim 05/06/97
*/
- if (fd < 0) {
- if ((fd = FileNameOpenFile(path, O_RDWR, 0600)) >= 0) {
- if (!IsBootstrapProcessingMode() &&
- FileRead(fd, (char *) &tmp, sizeof(tmp)) != 0) {
- FileClose(fd);
- return (-1);
- }
- }
+ if (fd < 0)
+ {
+ if ( !IsBootstrapProcessingMode() )
+ return (-1);
+ fd = FileNameOpenFile(path, O_RDWR, 0600); /* Bootstrap */
+ if ( fd < 0 )
+ return (-1);
}
if (CurFd >= Nfds) {