Check some unchecked fclose() results
| От | Chao Li |
|---|---|
| Тема | Check some unchecked fclose() results |
| Дата | |
| Msg-id | 191398CF-C65F-4751-B704-7C904BCBB80B@gmail.com обсуждение исходный текст |
| Ответы |
Re: Check some unchecked fclose() results
|
| Список | pgsql-hackers |
Hi, This morning, while reading through recent commits, I noticed that 69c57466a added a check for fclose(), with the explanationthat “write errors (like ENOSPC) may not be reported until close time.” More generally, an fclose() failure canalso reflect an earlier buffered write or flush failure that is only reported when the stream is closed. So it seems worthchecking these calls in other file-writing paths as well. So I did a quick search through the source tree, and I found several other fclose() calls whose results are not checked.This patch fixes some of them. My criteria for including cases in this patch were basically: * only output file descriptors * code paths where the logic is relatively clear and easy to handle If this patch gets processed, I would be happy to spend more time handling the remaining cases. Or, if committers think allremaining cases should be included in this patch, I would also be happy to expand it. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/
В списке pgsql-hackers по дате отправления: