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 writes: > > On Fri, Feb 20, 2015 at 12:59 AM, Noah Misch 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

Re: [HACKERS] pg_check_dir comments and implementation mismatch

2015-02-22 Thread Tom Lane
Robert Haas writes: > On Fri, Feb 20, 2015 at 12:59 AM, Noah Misch 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 closedir() implementation b

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 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 >> wrote: >> > I've attached a new version of the patch fixing the missing closedir on >> > readdir error. >> >> If readir() fai

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 > wrote: > > I've attached a new version of the patch fixing the missing closedir on > > readdir error. > > If readir() fails and closedir() succeeds, the return will be -1 but > errn

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 wrote: > Il 02/02/15 21:48, Robert Haas ha scritto: >> On Sat, Jan 31, 2015 at 8:28 AM, Marco Nenciarini >> wrote: >>> Il 30/01/15 03:54, Michael Paquier ha scritto: On Fri, Jan 30, 2015 at 2:49 AM, Tom Lane wrote: > There is at least on

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 > wrote: >> Il 30/01/15 03:54, Michael Paquier ha scritto: >>> On Fri, Jan 30, 2015 at 2:49 AM, Tom Lane wrote: There is at least one other bug in that function now that I look at it: in event

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 wrote: > Il 30/01/15 03:54, Michael Paquier ha scritto: >> On Fri, Jan 30, 2015 at 2:49 AM, Tom Lane 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 clo

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 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 call

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 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 s

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 > 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 ju

Re: [HACKERS] pg_check_dir comments and implementation mismatch

2015-01-29 Thread Tom Lane
Robert Haas writes: > On Thu, Jan 29, 2015 at 11:00 AM, Marco Nenciarini > 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 ar

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 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 behavio

[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 marco.nencia