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

From Michael Paquier
Subject Re: Use atexit() in initdb and pg_basebackup
Date
Msg-id 20190105012336.GE4849@paquier.xyz
Whole thread Raw
In response to Re: Use atexit() in initdb and pg_basebackup  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
On Fri, Jan 04, 2019 at 04:35:51PM -0300, Alvaro Herrera wrote:
> On 2018-Dec-29, Peter Eisentraut wrote:
>> @@ -3438,5 +3437,8 @@ main(int argc, char *argv[])
>>
>>      destroyPQExpBuffer(start_db_cmd);
>>
>> +    /* prevent cleanup */
>> +    made_new_pgdata = found_existing_pgdata = made_new_xlogdir = found_existing_xlogdir = false;
>> +
>>      return 0;
>>  }
>
> This is a bit ugly, but meh.
>
> Other than the first point, LGTM.

Re-meuh (French version).  That's partially a problem of this patch
because all those flags get reset.  I think that it would be cleaner
to replace all those boolean flags with just a simple bits16 or such,
making the flag cleanup reset way cleaner, and less error-prone if
more flag types are added in the future.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: A few new options for vacuumdb
Next
From: Michael Paquier
Date:
Subject: Re: Unable to `make install` on MacOS in the latest master(68a13f28be)