Re: pg_check_dir comments and implementation mismatch - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_check_dir comments and implementation mismatch
Date
Msg-id 10495.1422553769@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_check_dir comments and implementation mismatch  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: pg_check_dir comments and implementation mismatch
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Thu, Jan 29, 2015 at 11:00 AM, Marco Nenciarini
> <marco.nenciarini@2ndquadrant.it> wrote:
>> reading pgcheckdir.c code I noticed that the function comment
>> was outdated. The code now can return values from 0 to 4 while the
>> comment explains only values 0,1,2.

> This is not just a comment fix; you are clearly changing the behavior
> of the function in some way.

I think he's trying to fix a bug in terms of slipshod definition of the
non-empty-directory subcases, but it would be nice to have some
clarity about that.

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 ...
        regards, tom lane



pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: pg_upgrade and rsync
Next
From: Robert Haas
Date:
Subject: Re: File based Incremental backup v8