Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PGPRO-5771 #21

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
[PGPRO-5771] Use common macro for Windows and Linux.
Tags: ptrack
  • Loading branch information
antamel committed Mar 12, 2022
commit 511e341a510d29b88c1dfe97ba093c5e42c75e91
6 changes: 3 additions & 3 deletions engine.c
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@
#include "access/xlog.h"
#include "catalog/pg_tablespace.h"
#include "miscadmin.h"
#include "port/pg_crc32c.h"
#include "storage/checksum.h"
#include "storage/copydir.h"
#if PG_VERSION_NUM >= 120000
#include "storage/md.h"
@@ -77,7 +77,7 @@ ptrack_file_exists(const char *path)
static void
ptrack_write_chunk(int fd, pg_crc32c *crc, char *chunk, size_t size)
{
COMP_CRC32C(*crc, (char *) chunk, size);
COMP_CRC32_COMMON(*crc, (char *) chunk, size);

if (write(fd, chunk, size) != size)
{
@@ -197,7 +197,7 @@ ptrackMapReadFromFile(const char *ptrack_path)
pg_crc32c *file_crc;

INIT_CRC32C(crc);
COMP_CRC32C(crc, (char *) ptrack_map, PtrackCrcOffset);
COMP_CRC32_COMMON(crc, (char *) ptrack_map, PtrackCrcOffset);
FIN_CRC32C(crc);

file_crc = (pg_crc32c *) ((char *) ptrack_map + PtrackCrcOffset);