| От | Michael Paquier |
|---|---|
| Тема | Incorrect errno used in OpenWalSummaryFile() |
| Дата | |
| Msg-id | aYAf8qDHbpBZ3Rml@paquier.xyz обсуждение исходный текст |
| Ответы |
Re: Incorrect errno used in OpenWalSummaryFile()
|
| Список | pgsql-hackers |
Hi all,
While looking at walsummary.c for a different thread, I have bumped
into this code:
OpenWalSummaryFile(WalSummaryFile *ws, bool missing_ok)
[...]
file = PathNameOpenFile(path, O_RDONLY);
if (file < 0 && (errno != EEXIST || !missing_ok))
ereport(ERROR,
(errcode_for_file_access(),
errmsg("could not open file \"%s\": %m", path)));
And it seems to me that this EEXIST should be an ENOENT? The top of
the function also documents that we want to handle an error when a
summary file does not exist. The comment makes sense to me, not the
code.
It's also worth noting that this function has two callers, both use
missing_ok = false, meaning that the errno check does not really
matter today. If someone plays with this code on HEAD or the
back-branches and decides to introduce a missing_ok=true call, it
could matter, so I'd rather not change this function signature.
This issue has been mentioned here as well, I've just bumped into it
independently a few hours ago:
https://www.postgresql.org/message-id/tencent_1CA40FCC21C1C770712BC089@qq.com
Regards,
--
Michael
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера