Re: [HACKERS] Patch to implement pg_current_logfile() function - Mailing list pgsql-hackers

From Karl O. Pinc
Subject Re: [HACKERS] Patch to implement pg_current_logfile() function
Date
Msg-id 20170303075152.5c00e5cf@slate.meme.com
Whole thread Raw
In response to Re: [HACKERS] Patch to implement pg_current_logfile() function  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: [HACKERS] Patch to implement pg_current_logfile() function  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Fri, 3 Mar 2017 15:24:53 +0900
Michael Paquier <michael.paquier@gmail.com> wrote:
> 
> +           /*
> +            * No space found, file content is corrupted.  Return
> NULL to the
> +            * caller and inform him on the situation.
> +            */
> +           elog(ERROR,
> +                "missing space character in \"%s\"",
> LOG_METAINFO_DATAFILE);
> +           break;
> There is no need to issue a break after a elog(ERROR).

There's 2 cases of issuing a break after a elog(ERROR),
both in the same loop.

And the comment could then be amended as well to just:
 No space found, file content is corrupted

Because (I presume) there's no returning of any value
going on.

But if the code does not exit the loop then
before calling elog(ERROR), shouldn't it
also call FreeFile(fd)?

Regards,

Karl <kop@meme.com>
Free Software:  "You don't pay back, you pay forward."                -- Robert A. Heinlein



pgsql-hackers by date:

Previous
From: David Steele
Date:
Subject: Re: [HACKERS] make async slave to wait for lsn to be replayed
Next
From: David Steele
Date:
Subject: Re: [HACKERS] Block level parallel vacuum WIP