git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a27048c)
Fix thinko in assertion in basebackup.c.
2021年11月10日 15:12:20 +0000 (10:12 -0500)
2021年11月10日 15:12:20 +0000 (10:12 -0500)
Commit 5a1007a5088cd6ddf892f7422ea8dbaef362372f tried to introduce
an assertion that the block size was at least twice the size of a
tar block, but I got the math wrong. My error was reported to me
off-list.


diff --git a/src/backend/replication/basebackup.c b/src/backend/replication/basebackup.c
index 92430439f53acc064a33dde195d9c78c7b76be80..ec0485705df1712b12496f06b8c1c96456c9b07f 100644 (file)
--- a/src/backend/replication/basebackup.c
+++ b/src/backend/replication/basebackup.c
@@ -376,7 +376,7 @@ perform_base_backup(basebackup_options *opt, bbsink *sink)
else
{
/* Properly terminate the tarfile. */
- StaticAssertStmt(TAR_BLOCK_SIZE <= 2 * BLCKSZ,
+ StaticAssertStmt(2 * TAR_BLOCK_SIZE <= BLCKSZ,
"BLCKSZ too small for 2 tar blocks");
memset(sink->bbs_buffer, 0, 2 * TAR_BLOCK_SIZE);
bbsink_archive_contents(sink, 2 * TAR_BLOCK_SIZE);
@@ -621,7 +621,7 @@ perform_base_backup(basebackup_options *opt, bbsink *sink)
}
/* Properly terminate the tar file. */
- StaticAssertStmt(TAR_BLOCK_SIZE <= 2 * BLCKSZ,
+ StaticAssertStmt(2 * TAR_BLOCK_SIZE <= BLCKSZ,
"BLCKSZ too small for 2 tar blocks");
memset(sink->bbs_buffer, 0, 2 * TAR_BLOCK_SIZE);
bbsink_archive_contents(sink, 2 * TAR_BLOCK_SIZE);
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /