mirror of
https://github.com/postgres/postgres.git
synced 2025-11-16 15:02:33 +03:00
Remove NT-specific file open defines by defining our own open macros for
"rb" and "wb".
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.54 2000/05/30 04:24:50 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.55 2000/06/02 15:57:28 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -549,11 +549,7 @@ _ReadLOArray(char *str,
|
||||
{
|
||||
FILE *afd;
|
||||
|
||||
#ifndef __CYGWIN32__
|
||||
if ((afd = AllocateFile(accessfile, "r")) == NULL)
|
||||
#else
|
||||
if ((afd = AllocateFile(accessfile, "r")) == NULL)
|
||||
#endif
|
||||
if ((afd = AllocateFile(accessfile, PG_BINARY_R)) == NULL)
|
||||
elog(ERROR, "unable to open access pattern file");
|
||||
*chunkFlag = true;
|
||||
retStr = _ChunkArray(*fd, afd, ndim, dim, baseSize, nbytes,
|
||||
|
||||
14
src/backend/utils/cache/relcache.c
vendored
14
src/backend/utils/cache/relcache.c
vendored
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.98 2000/05/30 00:49:54 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.99 2000/06/02 15:57:30 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2122,11 +2122,7 @@ init_irels(void)
|
||||
int i;
|
||||
int relno;
|
||||
|
||||
#ifndef __CYGWIN32__
|
||||
if ((fd = FileNameOpenFile(RELCACHE_INIT_FILENAME, O_RDONLY, 0600)) < 0)
|
||||
#else
|
||||
if ((fd = FileNameOpenFile(RELCACHE_INIT_FILENAME, O_RDONLY | O_BINARY, 0600)) < 0)
|
||||
#endif
|
||||
if ((fd = FileNameOpenFile(RELCACHE_INIT_FILENAME, O_RDONLY | PG_BINARY, 0600)) < 0)
|
||||
{
|
||||
write_irels();
|
||||
return;
|
||||
@@ -2292,11 +2288,7 @@ write_irels(void)
|
||||
snprintf(finalfilename, sizeof(finalfilename), "%s%c%s",
|
||||
DatabasePath, SEP_CHAR, RELCACHE_INIT_FILENAME);
|
||||
|
||||
#ifndef __CYGWIN32__
|
||||
fd = PathNameOpenFile(tempfilename, O_WRONLY | O_CREAT | O_TRUNC, 0600);
|
||||
#else
|
||||
fd = PathNameOpenFile(tempfilename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0600);
|
||||
#endif
|
||||
fd = PathNameOpenFile(tempfilename, O_WRONLY | O_CREAT | O_TRUNC | PG_BINARY, 0600);
|
||||
if (fd < 0)
|
||||
elog(FATAL, "cannot create init file %s", tempfilename);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.46 2000/05/02 08:13:08 ishii Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.47 2000/06/02 15:57:32 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -207,11 +207,7 @@ SetCharSet()
|
||||
map_file = (char *) malloc((strlen(DataDir) +
|
||||
strlen(p) + 2) * sizeof(char));
|
||||
sprintf(map_file, "%s/%s", DataDir, p);
|
||||
#ifndef __CYGWIN32__
|
||||
file = AllocateFile(map_file, "r");
|
||||
#else
|
||||
file = AllocateFile(map_file, "rb");
|
||||
#endif
|
||||
file = AllocateFile(map_file, PG_BINARY_R);
|
||||
if (file == NULL)
|
||||
return;
|
||||
eof = false;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.37 2000/04/12 17:16:07 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.38 2000/06/02 15:57:34 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -146,11 +146,7 @@ GetRawDatabaseInfo(const char *name, Oid *db_id, char *path)
|
||||
dbfname = (char *) palloc(strlen(DataDir) + strlen(DatabaseRelationName) + 2);
|
||||
sprintf(dbfname, "%s%c%s", DataDir, SEP_CHAR, DatabaseRelationName);
|
||||
|
||||
#ifndef __CYGWIN32__
|
||||
if ((dbfd = open(dbfname, O_RDONLY, 0)) < 0)
|
||||
#else
|
||||
if ((dbfd = open(dbfname, O_RDONLY | O_BINARY, 0)) < 0)
|
||||
#endif
|
||||
if ((dbfd = open(dbfname, O_RDONLY | PG_BINARY, 0)) < 0)
|
||||
elog(FATAL, "cannot open %s: %s", dbfname, strerror(errno));
|
||||
|
||||
pfree(dbfname);
|
||||
|
||||
Reference in New Issue
Block a user