mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
Apply Win32 patch from Horak Daniel.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.24 1998/10/08 18:30:16 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.25 1999/01/17 06:18:54 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -338,7 +338,11 @@ SetCharSet()
|
||||
map_file = (char *) malloc((strlen(DataDir) +
|
||||
strlen(p) + 2) * sizeof(char));
|
||||
sprintf(map_file, "%s/%s", DataDir, p);
|
||||
#ifndef __CYGWIN32__
|
||||
file = fopen(map_file, "r");
|
||||
#else
|
||||
file = fopen(map_file, "rb");
|
||||
#endif
|
||||
if (file == NULL)
|
||||
return;
|
||||
eof = false;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.35 1998/09/01 04:33:17 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.36 1999/01/17 06:18:55 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* InitPostgres() is the function called from PostgresMain
|
||||
@@ -176,7 +176,11 @@ VerifySystemDatabase()
|
||||
|
||||
errormsg[0] = '\0';
|
||||
|
||||
#ifndef __CYGWIN32__
|
||||
if ((fd = open(DataDir, O_RDONLY, 0)) == -1)
|
||||
#else
|
||||
if ((fd = open(DataDir, O_RDONLY | O_DIROPEN, 0)) == -1)
|
||||
#endif
|
||||
sprintf(errormsg, "Database system does not exist. "
|
||||
"PGDATA directory '%s' not found.\n\tNormally, you "
|
||||
"create a database system by running initdb.",
|
||||
@@ -212,7 +216,11 @@ VerifyMyDatabase()
|
||||
name = DatabaseName;
|
||||
myPath = DatabasePath;
|
||||
|
||||
#ifndef __CYGWIN32__
|
||||
if ((fd = open(myPath, O_RDONLY, 0)) == -1)
|
||||
#else
|
||||
if ((fd = open(myPath, O_RDONLY | O_DIROPEN, 0)) == -1)
|
||||
#endif
|
||||
sprintf(errormsg,
|
||||
"Database '%s' does not exist."
|
||||
"\n\tWe know this because the directory '%s' does not exist."
|
||||
|
||||
Reference in New Issue
Block a user