Re: pg_basebackup: Missing newlines in some error messages - Mailing list pgsql-hackers

From Michael Banck
Subject Re: pg_basebackup: Missing newlines in some error messages
Date
Msg-id 1521636541.15036.6.camel@credativ.de
Whole thread Raw
In response to Re: pg_basebackup: Missing newlines in some error messages  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: pg_basebackup: Missing newlines in some error messages  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
Hi,

Am Mittwoch, den 21.03.2018, 09:46 -0300 schrieb Alvaro Herrera:
> Daniel Gustafsson wrote:
> > > On 21 Mar 2018, at 13:12, Michael Banck <michael.banck@credativ.de> wrote:
> > > while working on something else, I noticed that some error messages in
> > > pg_basebackup do not have a "\n" at the end, resulting in output like:
> > > 
> > > > pg_basebackup: could not get COPY data stream: pg_basebackup: removing
> > > > data directory “data2"
> > 
> > There seems to be a few more in the other files, for example this (and more) in
> > receivelog.c:
> > 
> > -               fprintf(stderr, _("%s: could not send feedback packet: %s"),
> > +               fprintf(stderr, _("%s: could not send feedback packet: %s\n"),
> > 
> > Should they get newlines appended as well?
> 
> Note that PQerrorMessage already appends a newline, so if the %s at the
> end comes from that, the newline is purposely missing.

Ah, I see, in that case my patch no longer makes sense.

I apparently managed to screw up so badly that no PQerrorMessage was
set, so saw the above (which indeed has no error message after the
colon).


Michael

-- 
Michael Banck
Projektleiter / Senior Berater
Tel.: +49 2166 9901-171
Fax:  +49 2166 9901-100
Email: michael.banck@credativ.de

credativ GmbH, HRB Mönchengladbach 12080
USt-ID-Nummer: DE204566209
Trompeterallee 108, 41189 Mönchengladbach
Geschäftsführung: Dr. Michael Meskes, Jörg Folz, Sascha Heuer


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: pg_basebackup: Missing newlines in some error messages
Next
From: Alvaro Herrera
Date:
Subject: Re: pg_basebackup: Missing newlines in some error messages