mirror of
https://github.com/postgres/postgres.git
synced 2025-05-05 09:19:17 +03:00
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 > */
This commit is contained in:
parent
b45128f1c3
commit
13f41aa90b
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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)
|
mdcreate(Relation reln)
|
||||||
{
|
{
|
||||||
int fd, vfd;
|
int fd, vfd;
|
||||||
int tmp;
|
|
||||||
char *path;
|
char *path;
|
||||||
extern bool IsBootstrapProcessingMode();
|
extern bool IsBootstrapProcessingMode();
|
||||||
|
|
||||||
@ -111,16 +110,19 @@ mdcreate(Relation reln)
|
|||||||
* create succeeded. During bootstrap processing, we skip that check,
|
* create succeeded. During bootstrap processing, we skip that check,
|
||||||
* because pg_time, pg_variable, and pg_log get created before their
|
* because pg_time, pg_variable, and pg_log get created before their
|
||||||
* .bki file entries are processed.
|
* .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 < 0)
|
||||||
if ((fd = FileNameOpenFile(path, O_RDWR, 0600)) >= 0) {
|
{
|
||||||
if (!IsBootstrapProcessingMode() &&
|
if ( !IsBootstrapProcessingMode() )
|
||||||
FileRead(fd, (char *) &tmp, sizeof(tmp)) != 0) {
|
return (-1);
|
||||||
FileClose(fd);
|
fd = FileNameOpenFile(path, O_RDWR, 0600); /* Bootstrap */
|
||||||
return (-1);
|
if ( fd < 0 )
|
||||||
}
|
return (-1);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CurFd >= Nfds) {
|
if (CurFd >= Nfds) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user