aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2023-10-31 11:59:14 -0400
committerBruce Momjian <bruce@momjian.us>2023-10-31 11:59:14 -0400
commit3fdc1d269345cac24275613f4d6b799e195d95a0 (patch)
treeb3635910541fc69a295843471b6cb85d639cef1f
parentb706172d22a29962c42c90f2c3c704c2a4141660 (diff)
downloadpostgresql-3fdc1d269345cac24275613f4d6b799e195d95a0.tar.gz
postgresql-3fdc1d269345cac24275613f4d6b799e195d95a0.zip
C comment: mention why no setting lasterrno in dir_existsfile()
Reported-by: Wei Sun Discussion: https://postgr.es/m/tencent_1276C08F98579CC19D8A4488C848A8411806@qq.com Backpatch-through: master
-rw-r--r--src/bin/pg_basebackup/walmethods.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/bin/pg_basebackup/walmethods.c b/src/bin/pg_basebackup/walmethods.c
index 2de11ce9b1c..33cb85b849e 100644
--- a/src/bin/pg_basebackup/walmethods.c
+++ b/src/bin/pg_basebackup/walmethods.c
@@ -594,6 +594,11 @@ dir_existsfile(WalWriteMethod *wwmethod, const char *pathname)
fd = open(tmppath, O_RDONLY | PG_BINARY, 0);
if (fd < 0)
+
+ /*
+ * Skip setting dir_data->lasterrno here because we are only checking
+ * for existence.
+ */
return false;
close(fd);
return true;