summaryrefslogtreecommitdiff
path: root/src/bin/pg_rewind/copy_fetch.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pg_rewind/copy_fetch.c')
-rw-r--r--src/bin/pg_rewind/copy_fetch.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bin/pg_rewind/copy_fetch.c b/src/bin/pg_rewind/copy_fetch.c
index 160a9128477..36d48899f74 100644
--- a/src/bin/pg_rewind/copy_fetch.c
+++ b/src/bin/pg_rewind/copy_fetch.c
@@ -156,7 +156,7 @@ recurse_dir(const char *datadir, const char *parentpath,
static void
rewind_copy_file_range(const char *path, off_t begin, off_t end, bool trunc)
{
- char buf[BLCKSZ];
+ PGAlignedBlock buf;
char srcpath[MAXPGPATH];
int srcfd;
@@ -182,7 +182,7 @@ rewind_copy_file_range(const char *path, off_t begin, off_t end, bool trunc)
else
len = end - begin;
- readlen = read(srcfd, buf, len);
+ readlen = read(srcfd, buf.data, len);
if (readlen < 0)
pg_fatal("could not read file \"%s\": %s\n",
@@ -190,7 +190,7 @@ rewind_copy_file_range(const char *path, off_t begin, off_t end, bool trunc)
else if (readlen == 0)
pg_fatal("unexpected EOF while reading file \"%s\"\n", srcpath);
- write_target_range(buf, begin, readlen);
+ write_target_range(buf.data, begin, readlen);
begin += readlen;
}