Re: [HACKERS] [patch] pg_dump/pg_restore zerror() and strerror()mishap - Mailing list pgsql-hackers

From Kunshchikov Vladimir
Subject Re: [HACKERS] [patch] pg_dump/pg_restore zerror() and strerror()mishap
Date
Msg-id 571149215d3c467dac8b000651507445@infotecs.ru
Whole thread Raw
In response to Re: [HACKERS] [patch] pg_dump/pg_restore zerror() and strerror()mishap  (Kunshchikov Vladimir <Vladimir.Kunshchikov@infotecs.ru>)
Responses Re: [HACKERS] [patch] pg_dump/pg_restore zerror() and strerror()mishap
Re: [HACKERS] [patch] pg_dump/pg_restore zerror() and strerror()mishap
List pgsql-hackers

Hello Alvaro,

here goes v4 version: removed unused header.

Compilation of this code snippet with -Wall -Wexter -std=c89 doesn't produce any warnings.


--
Best regards,
Vladimir Kunschikov
Lead software developer
IDS project
InfoTeCS JSC


From: Kunshchikov Vladimir
Sent: Thursday, July 27, 2017 10:34:22 AM
To: Alvaro Herrera
Cc: pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] [patch] pg_dump/pg_restore zerror() and strerror() mishap
 


Hello, Alvaro,

  thanks for the suggestions,  attached version #3 with all of your requirements met. 



--
С уважением,
Владимир Кунщиков
Ведущий программист

Отдел разработки систем обнаружения и предотвращения компьютерных атак
Компания "ИнфоТеКС"


From: Alvaro Herrera <alvherre@2ndquadrant.com>
Sent: Wednesday, July 26, 2017 7:40:20 PM
To: Kunshchikov Vladimir
Cc: pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] [patch] pg_dump/pg_restore zerror() and strerror() mishap
 
Kunshchikov Vladimir wrote:
>  Hello Alvaro, thanks for the feedback, fixed all of your points.
> Attached new version of patch.

Looks great -- it's a lot smaller than the original even.  One final
touch -- see cfread(), where we have an #ifdef where we test for
fp->compressedfp; the "#else" branch uses the same code as the
!fp->compressedfp.  I think your get_cfp_error can be written more
simply using that form.  (Also, your version probably errors or warns
about "code before declaration" in that routine, which is not allowed in
C89.)

--
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Attachment

pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: [HACKERS] Missing comment for max_logical_replication_workersin postgresql.conf.sample
Next
From: Kyotaro HORIGUCHI
Date:
Subject: Re: [HACKERS] asynchronous execution