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
This commit is contained in:
Bruce Momjian 2023-10-31 11:59:14 -04:00
parent b706172d22
commit 3fdc1d2693
1 changed files with 5 additions and 0 deletions

View File

@ -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;