Re: Errands around AllocateDir()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Errands around AllocateDir()
Date: 2017-12-04 22:17:21
Message-ID: 12680.1512425841@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Paquier <michael(dot)paquier(at)gmail(dot)com> writes:
> I had a close look at all the callers of AllocateDir() and noticed a
> couple of unwelcome things (Tom noticed some of those in the thread
> mentioned above, I found others):

Pushed with some minor additional fiddling. The most notable thing
I changed was that instead of this:

> - perform_base_backup() makes the mistake of not saving errno before
> CheckXLogRemoved() when AllocateDir returns NULL, which can lead to an
> incorrect error message.

I modified CheckXLogRemoved() to internally guarantee that it does not
change errno. This is because there seemed to be other call sites that
were depending on that, not just this one. Anyway, that seemed like a
more future-proof fix than relying on callers to deal with it.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2017-12-04 22:57:24 Re: [HACKERS] postgres_fdw super user checks
Previous Message Thomas Munro 2017-12-04 21:57:34 Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process