]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix incorrect errno in OpenWalSummaryFile()
authorMichael Paquier <michael@paquier.xyz>
Tue, 3 Feb 2026 02:25:16 +0000 (11:25 +0900)
committerMichael Paquier <michael@paquier.xyz>
Tue, 3 Feb 2026 02:25:16 +0000 (11:25 +0900)
commit3b15032dad50d18e45cf12070af13035bd1f2fe9
treeb1898fb3adbd19b1a346d9280e63b959f4e18b1a
parent5995135f13031b37ad167ed83b5249ba8419ade2
Fix incorrect errno in OpenWalSummaryFile()

This routine has an option to bypass an error if a WAL summary file is
opened for read but is missing (missing_ok=true).  However, the code
incorrectly checked for EEXIST, that matters when using O_CREAT and
O_EXCL, rather than ENOENT, for this case.

There are currently only two callers of OpenWalSummaryFile() in the
tree, and both use missing_ok=false, meaning that the check based on the
errno is currently dead code.  This issue could matter for out-of-core
code or future backpatches that would like to use missing_ok set to
true.

Issue spotted while monitoring this area of the code, after
a9afa021e95f.

Author: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/aYAf8qDHbpBZ3Rml@paquier.xyz
Backpatch-through: 17
src/backend/backup/walsummary.c