Commit 5b0bfec4 authored by Bruce Momjian's avatar Bruce Momjian

Fix compile for no O_SYNC, but introduced with O_DIRECT.

parent 90524998
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.213 2005/07/29 19:29:59 tgl Exp $ * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.214 2005/07/30 14:15:44 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -69,17 +69,18 @@ ...@@ -69,17 +69,18 @@
* default method. We assume that fsync() is always available, and that * default method. We assume that fsync() is always available, and that
* configure determined whether fdatasync() is. * configure determined whether fdatasync() is.
*/ */
#if defined(O_SYNC) #ifdef O_SYNC
#define CMP_OPEN_SYNC_FLAG O_SYNC #define CMP_OPEN_SYNC_FLAG O_SYNC
#else #elif defined(O_FSYNC)
#if defined(O_FSYNC)
#define CMP_OPEN_SYNC_FLAG O_FSYNC #define CMP_OPEN_SYNC_FLAG O_FSYNC
#endif #endif
#endif #ifdef CMP_OPEN_SYNC_FLAG
#define OPEN_SYNC_FLAG (CMP_OPEN_SYNC_FLAG | PG_O_DIRECT) #define OPEN_SYNC_FLAG (CMP_OPEN_SYNC_FLAG | PG_O_DIRECT)
#endif
#if defined(O_DSYNC) #ifdef O_DSYNC
#if defined(OPEN_SYNC_FLAG) #ifdef OPEN_SYNC_FLAG
/* O_DSYNC is distinct? */
#if O_DSYNC != CMP_OPEN_SYNC_FLAG #if O_DSYNC != CMP_OPEN_SYNC_FLAG
#define OPEN_DATASYNC_FLAG (O_DSYNC | PG_O_DIRECT) #define OPEN_DATASYNC_FLAG (O_DSYNC | PG_O_DIRECT)
#endif #endif
...@@ -114,7 +115,7 @@ ...@@ -114,7 +115,7 @@
#define XLOG_BUFFER_POINTERALIGN(PTR) \ #define XLOG_BUFFER_POINTERALIGN(PTR) \
POINTERALIGN((ALIGNOF_XLOG_BUFFER), (PTR)) POINTERALIGN((ALIGNOF_XLOG_BUFFER), (PTR))
#if defined(OPEN_DATASYNC_FLAG) #ifdef OPEN_DATASYNC_FLAG
#define DEFAULT_SYNC_METHOD_STR "open_datasync" #define DEFAULT_SYNC_METHOD_STR "open_datasync"
#define DEFAULT_SYNC_METHOD SYNC_METHOD_OPEN #define DEFAULT_SYNC_METHOD SYNC_METHOD_OPEN
#define DEFAULT_SYNC_FLAGBIT OPEN_DATASYNC_FLAG #define DEFAULT_SYNC_FLAGBIT OPEN_DATASYNC_FLAG
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment