Re: [HACKERS] pg_check_dir comments and implementation mismatch

2015-02-23 Thread Noah Misch
On Sun, Feb 22, 2015 at 07:57:41PM -0500, Tom Lane wrote: Robert Haas robertmh...@gmail.com writes: On Fri, Feb 20, 2015 at 12:59 AM, Noah Misch n...@leadboat.com wrote: On Mon, Feb 02, 2015 at 03:48:33PM -0500, Robert Haas wrote: If readir() fails and closedir() succeeds, the return will

Re: [HACKERS] pg_check_dir comments and implementation mismatch

2015-02-22 Thread Robert Haas
On Fri, Feb 20, 2015 at 12:59 AM, Noah Misch n...@leadboat.com wrote: On Mon, Feb 02, 2015 at 03:48:33PM -0500, Robert Haas wrote: On Sat, Jan 31, 2015 at 8:28 AM, Marco Nenciarini marco.nenciar...@2ndquadrant.it wrote: I've attached a new version of the patch fixing the missing closedir on

Re: [HACKERS] pg_check_dir comments and implementation mismatch

2015-02-22 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Fri, Feb 20, 2015 at 12:59 AM, Noah Misch n...@leadboat.com wrote: On Mon, Feb 02, 2015 at 03:48:33PM -0500, Robert Haas wrote: If readir() fails and closedir() succeeds, the return will be -1 but errno will be 0. Out of curiosity, have you seen a

Re: [HACKERS] pg_check_dir comments and implementation mismatch

2015-02-19 Thread Noah Misch
On Mon, Feb 02, 2015 at 03:48:33PM -0500, Robert Haas wrote: On Sat, Jan 31, 2015 at 8:28 AM, Marco Nenciarini marco.nenciar...@2ndquadrant.it wrote: I've attached a new version of the patch fixing the missing closedir on readdir error. If readir() fails and closedir() succeeds, the

Re: [HACKERS] pg_check_dir comments and implementation mismatch

2015-02-17 Thread Robert Haas
On Thu, Feb 12, 2015 at 9:31 AM, Marco Nenciarini marco.nenciar...@2ndquadrant.it wrote: Il 02/02/15 21:48, Robert Haas ha scritto: On Sat, Jan 31, 2015 at 8:28 AM, Marco Nenciarini marco.nenciar...@2ndquadrant.it wrote: Il 30/01/15 03:54, Michael Paquier ha scritto: On Fri, Jan 30, 2015 at

Re: [HACKERS] pg_check_dir comments and implementation mismatch

2015-02-12 Thread Marco Nenciarini
Il 02/02/15 21:48, Robert Haas ha scritto: On Sat, Jan 31, 2015 at 8:28 AM, Marco Nenciarini marco.nenciar...@2ndquadrant.it wrote: Il 30/01/15 03:54, Michael Paquier ha scritto: On Fri, Jan 30, 2015 at 2:49 AM, Tom Lane t...@sss.pgh.pa.us wrote: There is at least one other bug in that

Re: [HACKERS] pg_check_dir comments and implementation mismatch

2015-02-02 Thread Robert Haas
On Sat, Jan 31, 2015 at 8:28 AM, Marco Nenciarini marco.nenciar...@2ndquadrant.it wrote: Il 30/01/15 03:54, Michael Paquier ha scritto: On Fri, Jan 30, 2015 at 2:49 AM, Tom Lane t...@sss.pgh.pa.us wrote: There is at least one other bug in that function now that I look at it: in event of a

Re: [HACKERS] pg_check_dir comments and implementation mismatch

2015-01-31 Thread Marco Nenciarini
Il 30/01/15 03:54, Michael Paquier ha scritto: On Fri, Jan 30, 2015 at 2:49 AM, Tom Lane t...@sss.pgh.pa.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

Re: [HACKERS] pg_check_dir comments and implementation mismatch

2015-01-29 Thread Marco Nenciarini
Il 29/01/15 18:37, Robert Haas ha scritto: On Thu, Jan 29, 2015 at 11:00 AM, Marco Nenciarini marco.nenciar...@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

Re: [HACKERS] pg_check_dir comments and implementation mismatch

2015-01-29 Thread Robert Haas
On Thu, Jan 29, 2015 at 11:00 AM, Marco Nenciarini marco.nenciar...@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

Re: [HACKERS] pg_check_dir comments and implementation mismatch

2015-01-29 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Thu, Jan 29, 2015 at 11:00 AM, Marco Nenciarini marco.nenciar...@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

[HACKERS] pg_check_dir comments and implementation mismatch

2015-01-29 Thread Marco Nenciarini
Hi, 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. Patch attached. Regards, Marco -- Marco Nenciarini - 2ndQuadrant Italy PostgreSQL Training, Services and Support

Re: [HACKERS] pg_check_dir comments and implementation mismatch

2015-01-29 Thread Michael Paquier
On Fri, Jan 30, 2015 at 2:49 AM, Tom Lane t...@sss.pgh.pa.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