diff options
author | Bruce Momjian <bruce@momjian.us> | 2023-10-31 11:59:14 -0400 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2023-10-31 11:59:14 -0400 |
commit | 3fdc1d269345cac24275613f4d6b799e195d95a0 (patch) | |
tree | b3635910541fc69a295843471b6cb85d639cef1f | |
parent | b706172d22a29962c42c90f2c3c704c2a4141660 (diff) | |
download | postgresql-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.c | 5 |
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; |