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

Commitb9d01fe

Browse files
committed
Per Tatsuo's recommendation, change mdopen so that it won't
automatically create the file, except during bootstrap mode where thatseems to be necessary.
1 parent0041202 commitb9d01fe

File tree

1 file changed

+14
-4
lines changed
  • src/backend/storage/smgr

1 file changed

+14
-4
lines changed

‎src/backend/storage/smgr/md.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.52 1999/09/02 02:57:49 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.53 1999/09/05 23:24:53 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -284,13 +284,23 @@ mdopen(Relation reln)
284284
fd=FileNameOpenFile(path,O_RDWR |O_BINARY,0600);
285285
#endif
286286

287-
/* this should only happen during bootstrap processing */
288287
if (fd<0)
288+
{
289+
/* in bootstrap mode, accept mdopen as substitute for mdcreate */
290+
if (IsBootstrapProcessingMode())
291+
{
289292
#ifndef__CYGWIN32__
290-
fd=FileNameOpenFile(path,O_RDWR |O_CREAT |O_EXCL,0600);
293+
fd=FileNameOpenFile(path,O_RDWR |O_CREAT |O_EXCL,0600);
291294
#else
292-
fd=FileNameOpenFile(path,O_RDWR |O_CREAT |O_EXCL |O_BINARY,0600);
295+
fd=FileNameOpenFile(path,O_RDWR |O_CREAT |O_EXCL |O_BINARY,0600);
293296
#endif
297+
}
298+
if (fd<0)
299+
{
300+
elog(ERROR,"mdopen: couldn't open %s: %m",path);
301+
return-1;
302+
}
303+
}
294304

295305
vfd=_fdvec_alloc();
296306
if (vfd<0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp