Re: Patch pg_is_in_backup()
От | Gurjeet Singh |
---|---|
Тема | Re: Patch pg_is_in_backup() |
Дата | |
Msg-id | CABwTF4Xa6LpEKcSB1L3cks5HrpA8YE3STAPOmXxY1SW11TJyQw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Patch pg_is_in_backup() (Robert Haas <robertmhaas@gmail.com>) |
Ответы |
Re: Patch pg_is_in_backup()
|
Список | pgsql-hackers |
On Thu, Jun 14, 2012 at 1:29 PM, Robert Haas <robertmhaas@gmail.com> wrote:
A minor gripe:
+ /*
+ * Close the backup label file.
+ */
+ if (ferror(lfp) || FreeFile(lfp)) {
+ ereport(ERROR,
+ (errcode_for_file_access(),
+ errmsg("could not read file \"%s\": %m",
+ BACKUP_LABEL_FILE)));
+ }
+
If ferror(lfp) returns false, wouldn't we miss the FreeFile() and leak a file pointer?
On Thu, Jun 14, 2012 at 6:06 AM, Gabriele BartoliniCommitted.
<gabriele.bartolini@2ndquadrant.it> wrote:
> thank you very much for your patience (and thank you Marco for supporting
> me). I apologise for the delay.
>
> I have retested the updated patch and it works fine with me. It is "ready
> for committer" for me.
A minor gripe:
+ /*
+ * Close the backup label file.
+ */
+ if (ferror(lfp) || FreeFile(lfp)) {
+ ereport(ERROR,
+ (errcode_for_file_access(),
+ errmsg("could not read file \"%s\": %m",
+ BACKUP_LABEL_FILE)));
+ }
+
If ferror(lfp) returns false, wouldn't we miss the FreeFile() and leak a file pointer?
Regards,
--
Gurjeet Singh
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
В списке pgsql-hackers по дате отправления: