Fix a subtle bug exposed by recent wal_sync_method rearrangements.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 17 May 2008 17:24:57 +0000 (17:24 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 17 May 2008 17:24:57 +0000 (17:24 +0000)
Formerly, the default value of wal_sync_method was determined inside xlog.c,
but now it is determined inside guc.c.  guc.c was reading xlogdefs.h
without having read <fcntl.h>, leading to wrong determination of
DEFAULT_SYNC_METHOD.  Obviously xlogdefs.h needs to include <fcntl.h>
for itself to ensure stable results.

src/backend/access/transam/xlog.c
src/include/access/xlogdefs.h

index 910e0d4ab03ea3a0bd463de663c4ab8d67177b07..c25cdc90a99ab4abfe83dc64e1b3abc06bfe2499 100644 (file)
@@ -15,7 +15,6 @@
 #include "postgres.h"
 
 #include <ctype.h>
-#include <fcntl.h>
 #include <signal.h>
 #include <time.h>
 #include <sys/stat.h>
@@ -31,7 +30,6 @@
 #include "access/twophase.h"
 #include "access/xact.h"
 #include "access/xlog_internal.h"
-#include "access/xlogdefs.h"
 #include "access/xlogutils.h"
 #include "catalog/catversion.h"
 #include "catalog/pg_control.h"
index 5e03eb5e886075c890793618c02ccbeb9918bd92..57b215801a5fa56105d3f66cd76a56166d55d649 100644 (file)
@@ -12,6 +12,8 @@
 #ifndef XLOG_DEFS_H
 #define XLOG_DEFS_H
 
+#include <fcntl.h>                             /* need open() flags */
+
 /*
  * Pointer to a location in the XLOG.  These pointers are 64 bits wide,
  * because we don't want them ever to overflow.