public inbox for [email protected]
help / color / mirror / Atom feedFrom: Andreas Karlsson <[email protected]>
To: Chao Li <[email protected]>
To: PostgreSQL Hackers <[email protected]>
Subject: Re: Check some unchecked fclose() results
Date: Thu, 2 Apr 2026 03:16:33 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
On 3/23/26 3:22 AM, Chao Li wrote:
>> 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
Those criteria are not enough as can be evidenced from some of the cases
which you patched. I do not see why you would want to error out in the
following two cases:
1. When writing to e.g. a log file and we do not call pg_fatal() if a
write fails. Then it makes no sense to die on failed fclose().
2. When creating an empty file. I could be wrong here but in that case
fclose() cannot fail. Arguably maybe we should use open() and close()
then instead of fopen() and fclose() but handling an error which can
never happen does not add any value.
Please review your patches a bit careful before submitting. You are
doing some good work with finding bugs and reviewing patches but it is
clear you do not spend enough time per mail making sure it is not a
false positive.
--
Andreas Karlsson
Percona
view thread (3+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Check some unchecked fclose() results
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox