Skip to content

Commit 5b0bfec

Browse files
committed
Fix compile for no O_SYNC, but introduced with O_DIRECT.
1 parent 9052499 commit 5b0bfec

File tree

1 file changed

+9
-8
lines changed
  • src/backend/access/transam

1 file changed

+9
-8
lines changed

src/backend/access/transam/xlog.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.213 2005/07/29 19:29:59 tgl Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.214 2005/07/30 14:15:44 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -69,17 +69,18 @@
6969
* default method. We assume that fsync() is always available, and that
7070
* configure determined whether fdatasync() is.
7171
*/
72-
#if defined(O_SYNC)
72+
#ifdef O_SYNC
7373
#define CMP_OPEN_SYNC_FLAG O_SYNC
74-
#else
75-
#if defined(O_FSYNC)
74+
#elif defined(O_FSYNC)
7675
#define CMP_OPEN_SYNC_FLAG O_FSYNC
7776
#endif
78-
#endif
77+
#ifdef CMP_OPEN_SYNC_FLAG
7978
#define OPEN_SYNC_FLAG (CMP_OPEN_SYNC_FLAG | PG_O_DIRECT)
79+
#endif
8080

81-
#if defined(O_DSYNC)
82-
#if defined(OPEN_SYNC_FLAG)
81+
#ifdef O_DSYNC
82+
#ifdef OPEN_SYNC_FLAG
83+
/* O_DSYNC is distinct? */
8384
#if O_DSYNC != CMP_OPEN_SYNC_FLAG
8485
#define OPEN_DATASYNC_FLAG (O_DSYNC | PG_O_DIRECT)
8586
#endif
@@ -114,7 +115,7 @@
114115
#define XLOG_BUFFER_POINTERALIGN(PTR) \
115116
POINTERALIGN((ALIGNOF_XLOG_BUFFER), (PTR))
116117

117-
#if defined(OPEN_DATASYNC_FLAG)
118+
#ifdef OPEN_DATASYNC_FLAG
118119
#define DEFAULT_SYNC_METHOD_STR "open_datasync"
119120
#define DEFAULT_SYNC_METHOD SYNC_METHOD_OPEN
120121
#define DEFAULT_SYNC_FLAGBIT OPEN_DATASYNC_FLAG

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy