diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2014-04-16 10:21:09 +0300 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2014-04-16 10:26:36 +0300 |
commit | 848b9f05ab283724dd063d936a92568c1fdf422b (patch) | |
tree | e6f0804cb145b3c09841bc91a9dd6e07e5778551 /src/backend/access/transam/xlog.c | |
parent | ab76d8e9d672c661fe8ce4d9405dc8956b8ece9d (diff) | |
download | postgresql-848b9f05ab283724dd063d936a92568c1fdf422b.tar.gz postgresql-848b9f05ab283724dd063d936a92568c1fdf422b.zip |
Use correctly-sized buffer when zero-filling a WAL file.
I mixed up BLCKSZ and XLOG_BLCKSZ when I changed the way the buffer is
allocated a couple of weeks ago. With the default settings, they are both
8k, but they can be changed at compile-time.
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r-- | src/backend/access/transam/xlog.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 3551d94e223..0106cdf6380 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -3079,7 +3079,7 @@ XLogFileInit(XLogSegNo logsegno, bool *use_existent, bool use_lock) { char path[MAXPGPATH]; char tmppath[MAXPGPATH]; - char zbuffer_raw[BLCKSZ + MAXIMUM_ALIGNOF]; + char zbuffer_raw[XLOG_BLCKSZ + MAXIMUM_ALIGNOF]; char *zbuffer; XLogSegNo installed_segno; int max_advance; @@ -3139,7 +3139,7 @@ XLogFileInit(XLogSegNo logsegno, bool *use_existent, bool use_lock) * cycles transferring data to the kernel. */ zbuffer = (char *) MAXALIGN(zbuffer_raw); - memset(zbuffer, 0, BLCKSZ); + memset(zbuffer, 0, XLOG_BLCKSZ); for (nbytes = 0; nbytes < XLogSegSize; nbytes += XLOG_BLCKSZ) { errno = 0; |