postgresql/src/backend/backup
Michael Paquier 3b15032dad 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
a9afa021e9.

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
2026-02-03 11:25:16 +09:00
..
backup_manifest.c Fix error message related to end TLI in backup manifest 2026-01-18 17:25:00 +09:00
basebackup.c Fix unnecessary padding in incremental backups 2024-04-14 20:37:49 +02:00
basebackup_copy.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
basebackup_gzip.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
basebackup_incremental.c Don't set the truncation block length greater than RELSEG_SIZE. 2026-01-19 12:10:00 -05:00
basebackup_lz4.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
basebackup_progress.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
basebackup_server.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
basebackup_sink.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
basebackup_target.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
basebackup_throttle.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
basebackup_zstd.c Harmonize function parameter names for Postgres 17. 2024-06-12 17:01:51 -04:00
Makefile Add support for incremental backup. 2023-12-20 09:49:12 -05:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
walsummary.c Fix incorrect errno in OpenWalSummaryFile() 2026-02-03 11:25:16 +09:00
walsummaryfuncs.c Fix limit block handling in pg_wal_summary_contents(). 2024-07-09 09:29:11 +09:00