pg_waldump: Fix error message for WAL files smaller than XLOG_BLCKSZ.
authorAndres Freund
Fri, 25 Feb 2022 18:30:05 +0000 (10:30 -0800)
committerAndres Freund
Fri, 25 Feb 2022 18:31:16 +0000 (10:31 -0800)
commit9ff7fd9063ce918e458a643b53eda1cf95f7d115
treebc50677c5f5bee33857ac3988d4d90545f19e39f
parent7d80e93fb1f1059ba3691b2584bb16992d7d734e
pg_waldump: Fix error message for WAL files smaller than XLOG_BLCKSZ.

When opening a WAL file smaller than XLOG_BLCKSZ (e.g. 0 bytes long) while
determining the wal_segment_size, pg_waldump checked errno, despite errno not
being set by the short read. Resulting in a bogus error message.

Author: Kyotaro Horiguchi 
Discussion: https://postgr.es/m/20220214.181847.775024684568733277[email protected]
Backpatch: 11-, the bug was introducedin fc49e24fa
src/bin/pg_waldump/pg_waldump.c