From 6deb3bbe2bda3f03c89cc64867a3f647d8bacdf5 Mon Sep 17 00:00:00 2001 From: Sergey Cherkashin <4erkashin@list.ru> Date: Wed, 17 Oct 2018 15:40:08 +0300 Subject: [PATCH] fileEqualCRC() refactoring --- src/data.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/data.c b/src/data.c index 9d5267a8..b9b25b11 100644 --- a/src/data.c +++ b/src/data.c @@ -1738,8 +1738,8 @@ check_file_pages(pgFile *file, XLogRecPtr stop_lsn, static bool fileEqualCRC(const char *path1, const char *path2, bool path2_is_compressed) { - pg_crc32 crc_from; - pg_crc32 crc_to; + pg_crc32 crc1; + pg_crc32 crc2; /* Get checksum of backup file */ #ifdef HAVE_LIBZ @@ -1748,7 +1748,7 @@ fileEqualCRC(const char *path1, const char *path2, bool path2_is_compressed) char buf [1024]; gzFile gz_in = NULL; - INIT_CRC32C(crc_to); + INIT_CRC32C(crc2); gz_in = gzopen(path2, PG_BINARY_R); if (gz_in == NULL) { @@ -1771,11 +1771,11 @@ fileEqualCRC(const char *path1, const char *path2, bool path2_is_compressed) path1, path2); return false; } - COMP_CRC32C(crc_to, buf, read_len); + COMP_CRC32C(crc2, buf, read_len); if (gzeof(gz_in) || read_len == 0) break; } - FIN_CRC32C(crc_to); + FIN_CRC32C(crc2); if (gzclose(gz_in) != 0) elog(ERROR, "Cannot close compressed WAL file \"%s\": %s", @@ -1784,11 +1784,11 @@ fileEqualCRC(const char *path1, const char *path2, bool path2_is_compressed) else #endif { - crc_to = pgFileGetCRC(path2); + crc2 = pgFileGetCRC(path2); } /* Get checksum of original file */ - crc_from = pgFileGetCRC(path1); + crc1 = pgFileGetCRC(path1); - return EQ_CRC32C(crc_from, crc_to); + return EQ_CRC32C(crc1, crc2); }