Re: pg_basebackup: Missing newlines in some error messages

From: Michael Banck <michael(dot)banck(at)credativ(dot)de>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Magnus Hagander <magnus(at)hagander(dot)net>
Subject: Re: pg_basebackup: Missing newlines in some error messages
Date: 2018-03-21 12:49:01
Message-ID: 1521636541.15036.6.camel@credativ.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)banck(at)credativ(dot)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(dot)banck(at)credativ(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-03-21 12:54:39 Re: pg_basebackup: Missing newlines in some error messages
Previous Message Alvaro Herrera 2018-03-21 12:46:31 Re: pg_basebackup: Missing newlines in some error messages