Re: pg_check_dir comments and implementation mismatch

From: Marco Nenciarini <marco(dot)nenciarini(at)2ndquadrant(dot)it>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_check_dir comments and implementation mismatch
Date: 2015-01-31 13:28:05
Message-ID: 54CCD865.7000907@2ndquadrant.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Il 30/01/15 03:54, Michael Paquier ha scritto:
> On Fri, Jan 30, 2015 at 2:49 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> There is at least one other bug in that function now that I look at it:
>> in event of a readdir() failure, it neglects to execute closedir().
>> Perhaps not too significant since all existing callers will just exit()
>> anyway after a failure, but still ...
> I would imagine that code scanners like coverity or similar would not
> be happy about that. ISTM that it is better to closedir()
> appropriately in all the code paths.
>

I've attached a new version of the patch fixing the missing closedir on
readdir error.

Regards,
Marco

--
Marco Nenciarini - 2ndQuadrant Italy
PostgreSQL Training, Services and Support
marco(dot)nenciarini(at)2ndQuadrant(dot)it | www.2ndQuadrant.it

Attachment Content-Type Size
pg_check_dir-comments-and-code.patch text/plain 2.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Roger Pack 2015-01-31 13:55:31 Re: Fwd: [GENERAL] 4B row limit for CLOB tables
Previous Message Amit Kapila 2015-01-31 13:27:23 Re: TABLESAMPLE patch