1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-15 03:41:20 +03:00

Apply Win32 patch from Horak Daniel.

This commit is contained in:
Bruce Momjian
1999-01-17 06:20:06 +00:00
parent 298682d9e0
commit 7a6b562fdf
58 changed files with 484 additions and 86 deletions

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.34 1998/09/01 04:32:24 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.35 1999/01/17 06:18:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -550,7 +550,11 @@ _ReadLOArray(char *str,
{
FILE *afd;
#ifndef __CYGWIN32__
if ((afd = AllocateFile(accessfile, "r")) == NULL)
#else
if ((afd = AllocateFile(accessfile, "r")) == NULL)
#endif
elog(ERROR, "unable to open access pattern file");
*chunkFlag = true;
retStr = _ChunkArray(*fd, afd, ndim, dim, baseSize, nbytes,

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.52 1998/12/15 12:46:37 vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.53 1999/01/17 06:18:51 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1861,7 +1861,11 @@ init_irels(void)
int i;
int relno;
#ifndef __CYGWIN32__
if ((fd = FileNameOpenFile(INIT_FILENAME, O_RDONLY, 0600)) < 0)
#else
if ((fd = FileNameOpenFile(INIT_FILENAME, O_RDONLY | O_BINARY, 0600)) < 0)
#endif
{
write_irels();
return;
@@ -2022,7 +2026,11 @@ write_irels(void)
int relno;
RelationBuildDescInfo bi;
#ifndef __CYGWIN32__
fd = FileNameOpenFile(INIT_FILENAME, O_WRONLY | O_CREAT | O_TRUNC, 0600);
#else
fd = FileNameOpenFile(INIT_FILENAME, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0600);
#endif
if (fd < 0)
elog(FATAL, "cannot create init file %s", INIT_FILENAME);

View File

@@ -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;

View File

@@ -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."

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.21 1998/11/27 19:52:29 vadim Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.22 1999/01/17 06:18:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -198,7 +198,11 @@ GetRawDatabaseInfo(char *name, int4 *owner, Oid *db_id, char *path, int *encodin
sprintf(dbfname, "%s%cpg_database", DataDir, SEP_CHAR);
fileflags = O_RDONLY;
#ifndef __CYGWIN32__
if ((dbfd = open(dbfname, O_RDONLY, 0)) < 0)
#else
if ((dbfd = open(dbfname, O_RDONLY | O_BINARY, 0)) < 0)
#endif
elog(FATAL, "Cannot open %s", dbfname);
pfree(dbfname);

View File

@@ -345,7 +345,11 @@ read_pg_options(SIGNAL_ARGS)
}
snprintf(buffer, BUF_SIZE - 1, "%s/%s", DataDir, "pg_options");
#ifndef __CYGWIN32__
if ((fd = open(buffer, O_RDONLY)) < 0)
#else
if ((fd = open(buffer, O_RDONLY | O_BINARY)) < 0)
#endif
return;
if ((n = read(fd, buffer, BUF_SIZE - 1)) > 0)

View File

@@ -4,7 +4,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: psort.c,v 1.46 1999/01/01 04:48:49 momjian Exp $
* $Id: psort.c,v 1.47 1999/01/17 06:19:02 momjian Exp $
*
* NOTES
* Sorts the first relation into the second relation.
@@ -1033,8 +1033,11 @@ gettape()
StrNCpy(tp->tl_name, uniqueName, MAXPGPATH);
#ifndef __CYGWIN32__
file = AllocateFile(tp->tl_name, "w+");
#else
file = AllocateFile(tp->tl_name, "w+b");
#endif
if (file == NULL)
elog(ERROR, "Open: %s in %s line %d, %s", tp->tl_name,
__FILE__, __LINE__, strerror(errno));