Re: Use atexit() in initdb and pg_basebackup - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Use atexit() in initdb and pg_basebackup
Date
Msg-id 201901051542.macmepgkz3zr@alvherre.pgsql
Whole thread Raw
In response to Re: Use atexit() in initdb and pg_basebackup  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: Use atexit() in initdb and pg_basebackup  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
On 2019-Jan-05, Peter Eisentraut wrote:

> On 04/01/2019 20:35, Alvaro Herrera wrote:

> >> +    /* prevent cleanup */
> >> +    made_new_pgdata = found_existing_pgdata = made_new_xlogdir = found_existing_xlogdir = false;
> >> +
> >>      return 0;
> >>  }
> > 
> > This is a bit ugly, but meh.
> 
> Yeah.  Actually, we already have a solution of this in pg_basebackup,
> with a bool success variable.  I rewrote it like that.  At least it's
> better for uniformity.

Ah, yeah, much better, LGTM.

> I also added an atexit() conversion in isolationtester.  It's mostly the
> same thing.

LGTM in a quick eyeball.

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


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [PATCH] Improvements to "Getting started" tutorial for GoogleCode-in task
Next
From: Tom Lane
Date:
Subject: Re: [proposal] Add an option for returning SQLSTATE in psql error message