mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +03:00
Remove NT-specific file open defines by defining our own open macros for
"rb" and "wb".
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.15 2000/06/02 10:20:25 vadim Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.16 2000/06/02 15:57:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -746,11 +746,7 @@ XLogFileInit(uint32 log, uint32 seg)
|
||||
XLogFileName(path, log, seg);
|
||||
unlink(path);
|
||||
|
||||
#ifndef __CYGWIN__
|
||||
fd = BasicOpenFile(path, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
|
||||
#else
|
||||
fd = BasicOpenFile(path, O_RDWR | O_CREAT | O_EXCL | O_BINARY, S_IRUSR | S_IWUSR);
|
||||
#endif
|
||||
fd = BasicOpenFile(path, O_RDWR | O_CREAT | O_EXCL | PG_BINARY, S_IRUSR | S_IWUSR);
|
||||
if (fd < 0)
|
||||
elog(STOP, "Open(logfile %u seg %u) failed: %d",
|
||||
logId, logSeg, errno);
|
||||
@ -782,11 +778,7 @@ XLogFileOpen(uint32 log, uint32 seg, bool econt)
|
||||
|
||||
XLogFileName(path, log, seg);
|
||||
|
||||
#ifndef __CYGWIN__
|
||||
fd = BasicOpenFile(path, O_RDWR, S_IRUSR | S_IWUSR);
|
||||
#else
|
||||
fd = BasicOpenFile(path, O_RDWR | O_BINARY, S_IRUSR | S_IWUSR);
|
||||
#endif
|
||||
fd = BasicOpenFile(path, O_RDWR | PG_BINARY, S_IRUSR | S_IWUSR);
|
||||
if (fd < 0)
|
||||
{
|
||||
if (econt && errno == ENOENT)
|
||||
@ -1096,11 +1088,7 @@ UpdateControlFile()
|
||||
{
|
||||
int fd;
|
||||
|
||||
#ifndef __CYGWIN__
|
||||
fd = BasicOpenFile(ControlFilePath, O_RDWR, S_IRUSR | S_IWUSR);
|
||||
#else
|
||||
fd = BasicOpenFile(ControlFilePath, O_RDWR | O_BINARY, S_IRUSR | S_IWUSR);
|
||||
#endif
|
||||
fd = BasicOpenFile(ControlFilePath, O_RDWR | PG_BINARY, S_IRUSR | S_IWUSR);
|
||||
if (fd < 0)
|
||||
elog(STOP, "Open(cntlfile) failed: %d", errno);
|
||||
|
||||
@ -1158,11 +1146,7 @@ BootStrapXLOG()
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef __CYGWIN__
|
||||
fd = BasicOpenFile(ControlFilePath, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
|
||||
#else
|
||||
fd = BasicOpenFile(ControlFilePath, O_RDWR | O_CREAT | O_EXCL | O_BINARY, S_IRUSR | S_IWUSR);
|
||||
#endif
|
||||
fd = BasicOpenFile(ControlFilePath, O_RDWR | O_CREAT | O_EXCL | PG_BINARY, S_IRUSR | S_IWUSR);
|
||||
if (fd < 0)
|
||||
elog(STOP, "BootStrapXLOG failed to create control file (%s): %d",
|
||||
ControlFilePath, errno);
|
||||
@ -1273,11 +1257,7 @@ StartupXLOG()
|
||||
/*
|
||||
* Open/read Control file
|
||||
*/
|
||||
#ifndef __CYGWIN__
|
||||
fd = BasicOpenFile(ControlFilePath, O_RDWR, S_IRUSR | S_IWUSR);
|
||||
#else
|
||||
fd = BasicOpenFile(ControlFilePath, O_RDWR | O_BINARY, S_IRUSR | S_IWUSR);
|
||||
#endif
|
||||
fd = BasicOpenFile(ControlFilePath, O_RDWR | PG_BINARY, S_IRUSR | S_IWUSR);
|
||||
if (fd < 0)
|
||||
elog(STOP, "Open(\"%s\") failed: %d", ControlFilePath, errno);
|
||||
|
||||
|
Reference in New Issue
Block a user