|
7 | 7 | *
|
8 | 8 | *
|
9 | 9 | * 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 $ |
11 | 11 | *
|
12 | 12 | *-------------------------------------------------------------------------
|
13 | 13 | */
|
@@ -284,13 +284,23 @@ mdopen(Relation reln)
|
284 | 284 | fd=FileNameOpenFile(path,O_RDWR |O_BINARY,0600);
|
285 | 285 | #endif
|
286 | 286 |
|
287 |
| -/* this should only happen during bootstrap processing */ |
288 | 287 | if (fd<0)
|
| 288 | +{ |
| 289 | +/* in bootstrap mode, accept mdopen as substitute for mdcreate */ |
| 290 | +if (IsBootstrapProcessingMode()) |
| 291 | +{ |
289 | 292 | #ifndef__CYGWIN32__
|
290 |
| -fd=FileNameOpenFile(path,O_RDWR |O_CREAT |O_EXCL,0600); |
| 293 | +fd=FileNameOpenFile(path,O_RDWR |O_CREAT |O_EXCL,0600); |
291 | 294 | #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); |
293 | 296 | #endif
|
| 297 | +} |
| 298 | +if (fd<0) |
| 299 | +{ |
| 300 | +elog(ERROR,"mdopen: couldn't open %s: %m",path); |
| 301 | +return-1; |
| 302 | +} |
| 303 | +} |
294 | 304 |
|
295 | 305 | vfd=_fdvec_alloc();
|
296 | 306 | if (vfd<0)
|
|