Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0b1020a

Browse files
committed
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) whiledetermining the wal_segment_size, pg_waldump checked errno, despite errno notbeing set by the short read. Resulting in a bogus error message.Author: Kyotaro Horiguchi <horikyota.ntt@gmail.com>Discussion:https://postgr.es/m/20220214.181847.775024684568733277.horikyota.ntt@gmail.comBackpatch: 11-, the bug was introducedinfc49e24
1 parentc255148 commit0b1020a

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

‎src/bin/pg_waldump/pg_waldump.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,12 @@ search_directory(const char *directory, const char *fname)
204204
WalSegSz),
205205
fname,WalSegSz);
206206
}
207+
elseif (r<0)
208+
fatal_error("could not read file \"%s\": %m",
209+
fname);
207210
else
208-
{
209-
if (errno!=0)
210-
fatal_error("could not read file \"%s\": %m",
211-
fname);
212-
else
213-
fatal_error("could not read file \"%s\": read %d of %zu",
214-
fname,r, (Size)XLOG_BLCKSZ);
215-
}
211+
fatal_error("could not read file \"%s\": read %d of %zu",
212+
fname,r, (Size)XLOG_BLCKSZ);
216213
close(fd);
217214
return true;
218215
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp