Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 1a604b4

Browse files
committed
Fix a subtle bug exposed by recent wal_sync_method rearrangements.
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.
1 parent 55f6f8f commit 1a604b4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/backend/access/transam/xlog.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@
77
* Portions Copyright (c) 1996-2008, 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.310 2008/05/16 19:15:05 tgl Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.311 2008/05/17 17:24:57 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
1414

1515
#include "postgres.h"
1616

1717
#include <ctype.h>
18-
#include <fcntl.h>
1918
#include <signal.h>
2019
#include <time.h>
2120
#include <sys/stat.h>
@@ -31,7 +30,6 @@
3130
#include "access/twophase.h"
3231
#include "access/xact.h"
3332
#include "access/xlog_internal.h"
34-
#include "access/xlogdefs.h"
3533
#include "access/xlogutils.h"
3634
#include "catalog/catversion.h"
3735
#include "catalog/pg_control.h"

src/include/access/xlogdefs.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/access/xlogdefs.h,v 1.21 2008/05/17 16:49:23 tgl Exp $
10+
* $PostgreSQL: pgsql/src/include/access/xlogdefs.h,v 1.22 2008/05/17 17:24:57 tgl Exp $
1111
*/
1212
#ifndef XLOG_DEFS_H
1313
#define XLOG_DEFS_H
1414

15+
#include <fcntl.h> /* need open() flags */
16+
1517
/*
1618
* Pointer to a location in the XLOG. These pointers are 64 bits wide,
1719
* because we don't want them ever to overflow.

0 commit comments

Comments
 (0)