Re: pg_dump, gzwrite, and errno

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, pgsql-hackers(at)postgresql(dot)org, Kunshchikov Vladimir <Vladimir(dot)Kunshchikov(at)infotecs(dot)ru>
Subject: Re: pg_dump, gzwrite, and errno
Date: 2020-06-19 21:30:47
Message-ID: 20200619213047.GA7048@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-Jun-18, Tom Lane wrote:

> Surely it's insufficient as-is, because there is no reason to suppose
> that errno is zero at entry. You'd need to set errno = 0 first.

Oh, right.

> Also it's fairly customary in our sources to include a comment about
> this machination; so the full ritual is usually more like

Yeah, I had that in my local copy. Done like that in all the most
obvious places. But there are more places that are still wrong: I
believe every single place that calls WRITE_ERROR_EXIT is doing the
wrong thing.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2020-06-19 21:33:26 Re: pg_regress cleans up tablespace twice.
Previous Message Tom Lane 2020-06-19 20:49:23 Re: More tzdb fun: POSIXRULES is being deprecated upstream