Re: pgsql: Improve pg_check_dir code and comments. - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: Improve pg_check_dir code and comments.
Date
Msg-id 25821.1424187924@sss.pgh.pa.us
Whole thread Raw
In response to pgsql: Improve pg_check_dir code and comments.  (Robert Haas <rhaas@postgresql.org>)
Responses Re: pgsql: Improve pg_check_dir code and comments.
List pgsql-committers
Robert Haas <rhaas@postgresql.org> writes:
> Improve pg_check_dir code and comments.
> Avoid losing errno if readdir() fails and closedir() works.  Consistently
> return 4 rather than 3 if both a lost+found directory and other files are
> found, rather than returning one value or the other depending on the
> order of the directory listing.  Update comments to match the actual
> behavior.

> These oversights date to commits 6f03927fce038096f53ca67eeab9adb24938f8a6
> and 17f15239325a88581bb4f9cf91d38005f1f52d69.

In that case, doesn't this need to be back-patched?

In addition to the problems you cite, the previous coding appears to fail
to close the directory handle if readdir() fails, which is certainly a
significant enough bug to merit back-patching.

            regards, tom lane


pgsql-committers by date:

Previous
From: Robert Haas
Date:
Subject: pgsql: Improve pg_check_dir code and comments.
Next
From: Robert Haas
Date:
Subject: Re: pgsql: Improve pg_check_dir code and comments.